summaryrefslogtreecommitdiff
path: root/fs/mbcache.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2018-01-19 00:17:13 +0300
committerBob Peterson <rpeterso@redhat.com>2018-01-19 00:17:13 +0300
commit786ebd9f68cdf512f389e5f2d0015f1beb0777d8 (patch)
treeb4bae82884c2232f891aec11e58b38eb4fec5e5d /fs/mbcache.c
parent1f23bc7869fffec40b8bd9333a74a18d1de54d98 (diff)
parent4e56a6411fbce6f859566e17298114c2434391a4 (diff)
downloadlinux-786ebd9f68cdf512f389e5f2d0015f1beb0777d8.tar.xz
Merge branch 'punch-hole' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git
Diffstat (limited to 'fs/mbcache.c')
-rw-r--r--fs/mbcache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/mbcache.c b/fs/mbcache.c
index d818fd236787..b8b8b9ced9f8 100644
--- a/fs/mbcache.c
+++ b/fs/mbcache.c
@@ -269,6 +269,9 @@ 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;
}