summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMichael Lyle <mlyle@lyle.org>2017-11-25 02:14:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-02-03 19:39:01 +0300
commitf9f175778bb9e4a5fe6d46efde1b353f15fde1fa (patch)
treebdaa80e39909c1028fd13827be00af5d513d8356 /drivers/md
parent1392633bafde919b3d78449b8a1a1c9f50f2b72e (diff)
downloadlinux-f9f175778bb9e4a5fe6d46efde1b353f15fde1fa.tar.xz
bcache: check return value of register_shrinker
[ Upstream commit 6c4ca1e36cdc1a0a7a84797804b87920ccbebf51 ] register_shrinker is now __must_check, so check it to kill a warning. Caller of bch_btree_cache_alloc in super.c appropriately checks return value so this is fully plumbed through. This V2 fixes checkpatch warnings and improves the commit description, as I was too hasty getting the previous version out. Signed-off-by: Michael Lyle <mlyle@lyle.org> Reviewed-by: Vojtech Pavlik <vojtech@suse.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bcache/btree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 658c54b3b07a..1598d1e04989 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -807,7 +807,10 @@ int bch_btree_cache_alloc(struct cache_set *c)
c->shrink.scan_objects = bch_mca_scan;
c->shrink.seeks = 4;
c->shrink.batch = c->btree_pages * 2;
- register_shrinker(&c->shrink);
+
+ if (register_shrinker(&c->shrink))
+ pr_warn("bcache: %s: could not register shrinker",
+ __func__);
return 0;
}