linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers3@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-ext4@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Theodore Ts'o <tytso@mit.edu>, Eric Biggers <ebiggers@google.com>,
	Jan Kara <jack@suse.cz>, Jiang Biao <jiang.biao2@zte.com.cn>
Subject: [PATCH] Revert "fs/mbcache.c: make count_objects() more robust"
Date: Sat,  6 Jan 2018 10:06:54 -0800	[thread overview]
Message-ID: <20180106180654.7373-1-ebiggers3@gmail.com> (raw)

From: Eric Biggers <ebiggers@google.com>

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 <jack@suse.cz>
Cc: Jiang Biao <jiang.biao2@zte.com.cn>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 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;
 }
 
-- 
2.15.1

             reply	other threads:[~2018-01-06 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-06 18:06 Eric Biggers [this message]
2018-01-07 21:04 ` [PATCH] Revert "fs/mbcache.c: make count_objects() more robust" Theodore Ts'o
2018-01-07 21:36 ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180106180654.7373-1-ebiggers3@gmail.com \
    --to=ebiggers3@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiggers@google.com \
    --cc=jack@suse.cz \
    --cc=jiang.biao2@zte.com.cn \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).