summaryrefslogtreecommitdiffstats
path: root/fs/quota
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2017-11-29 22:34:50 +0900
committerBen Hutchings <ben@decadent.org.uk>2018-03-03 15:51:39 +0000
commit94c2ab5a14372b8c0d2cfe9ff54833989c701229 (patch)
treed77eaed3687aef1b7a81117fcafe24e52e4359c9 /fs/quota
parentf7f83b90a0eb5a15480334a3e4e911101e1b2573 (diff)
downloadlinux-stable-94c2ab5a14372b8c0d2cfe9ff54833989c701229.tar.gz
linux-stable-94c2ab5a14372b8c0d2cfe9ff54833989c701229.tar.bz2
linux-stable-94c2ab5a14372b8c0d2cfe9ff54833989c701229.zip
quota: Check for register_shrinker() failure.
commit 88bc0ede8d35edc969350852894dc864a2dc1859 upstream. register_shrinker() might return -ENOMEM error since Linux 3.12. Call panic() as with other failure checks in this function if register_shrinker() failed. Fixes: 1d3d4437eae1 ("vmscan: per-node deferred work") Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Cc: Jan Kara <jack@suse.com> Cc: Michal Hocko <mhocko@suse.com> Reviewed-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 29552a0a2cf2..8ec56dbacaba 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2747,7 +2747,8 @@ static int __init dquot_init(void)
printk("Dquot-cache hash table entries: %ld (order %ld, %ld bytes)\n",
nr_hash, order, (PAGE_SIZE << order));
- register_shrinker(&dqcache_shrinker);
+ if (register_shrinker(&dqcache_shrinker))
+ panic("Cannot register dquot shrinker");
return 0;
}