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: 10147979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D585260153 for ; Sat, 6 Jan 2018 18:10:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA05628880 for ; Sat, 6 Jan 2018 18:10:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEAE828887; Sat, 6 Jan 2018 18:10:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5075428880 for ; Sat, 6 Jan 2018 18:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752778AbeAFSKP (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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }