From patchwork Sat Jan 6 18:06:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 856429 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XpTa/CDW"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zDV285wzsz9s8J for ; Sun, 7 Jan 2018 05:10:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752808AbeAFSKP (ORCPT ); Sat, 6 Jan 2018 13:10:15 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:44165 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbeAFSKO (ORCPT ); Sat, 6 Jan 2018 13:10:14 -0500 Received: by mail-pf0-f194.google.com with SMTP id m26so3529622pfj.11; Sat, 06 Jan 2018 10:10:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=l7GLbTJ1bwA39pDJkH88J+X/R/qCz4Xb+iYom3ncUuo=; b=XpTa/CDWQmZUpwMEh6KbPccBTAPWXgQKom3S475fHTXbMdF/SRhaqAZHzwKWyCnvok CIx/RTjXttnBCHhfBgspj5LR85YVZdMnIXEUSoqRHFpjUv2fJMfKokc4+QPCj5xkFMD+ sLaiuiNENtaPHu9qT47n76UR5JxrC6J3ptebNpeWf/qvcabQg+biIXvXIF2QP2saMkiQ 45YIj8JxaLLfgKmHZjLKQScitHJQsEbRq93WzRtP6L0ICMsd7m9+80aPwHr2P1yjGJ6f 5txMo2cD396KSbJ9oGYAQuOEg+h3PVxfNtoW7rKc+8nE2T9v2+Lg64CFavgQgrwXKBQo jlSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=l7GLbTJ1bwA39pDJkH88J+X/R/qCz4Xb+iYom3ncUuo=; b=iwNyEOXmTrgdnP6eVqox412/e3e55u4OoA2etEWMUNtG5kqPlSb7PE4cxbtNGtwYbk kwL37jHZYtK0zTZptWnBTExnS3iaLqy+nEub3KL0dARd4wMmgfP5ZIaXmaJ7ZWc+ba4u iEThhwdVn506f0V9+ISK3i3Pdk9O3Nvgf4FJNbl+j+Xn3c096m2gNL459C2BIxPAHVyD oesz5aQtKs3Z+DzthK1iJnoRlKUGidAIqA28i76OrHm7dQVDXKEQ7GmkQf4B7kNPMGXF v6lM8FJtpfJE/g6BET+ZI5FyOENZpyrERvnQpDGL1Si2lpOJx34u64bSUNMkgAmY9V4y vTTg== X-Gm-Message-State: AKGB3mLiGM1sj2o8P2h4F5q8tPH8Qxh4GrIWhREV9oIW0wV8Qo/8nQSh bsy13Wl92dVgYm2h/OevNKQvEMNn X-Google-Smtp-Source: ACJfBou7iM+JA861ceelSrO5+FvL3syux3DXNKtzcHuS8OaloqLH3JQ4E+9f5KpjdqaTD9dMGFZ/Ew== X-Received: by 10.101.82.2 with SMTP id o2mr5651699pgp.15.1515262213490; Sat, 06 Jan 2018 10:10:13 -0800 (PST) Received: from zzz.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id c28sm19848051pfe.69.2018.01.06.10.10.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2018 10:10:13 -0800 (PST) From: Eric Biggers To: linux-fsdevel@vger.kernel.org Cc: linux-ext4@vger.kernel.org, Andrew Morton , Theodore Ts'o , Eric Biggers , Jan Kara , Jiang Biao Subject: [PATCH] Revert "fs/mbcache.c: make count_objects() more robust" Date: Sat, 6 Jan 2018 10:06:54 -0800 Message-Id: <20180106180654.7373-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.1 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Eric Biggers This reverts commit d5dabd633922ac5ee5bcc67748f7defb8b211469. This patch did absolutely nothing, because ->c_entry_count is unsigned. In addition if there is a bug in how mbcache maintains its entry count, it needs to be fixed, not just hacked around. (There is no obvious bug, though.) Cc: Jan Kara Cc: Jiang Biao Signed-off-by: Eric Biggers --- fs/mbcache.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/mbcache.c b/fs/mbcache.c index b8b8b9ced9f8..d818fd236787 100644 --- a/fs/mbcache.c +++ b/fs/mbcache.c @@ -269,9 +269,6 @@ static unsigned long mb_cache_count(struct shrinker *shrink, struct mb_cache *cache = container_of(shrink, struct mb_cache, c_shrink); - /* Unlikely, but not impossible */ - if (unlikely(cache->c_entry_count < 0)) - return 0; return cache->c_entry_count; }