All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcache: check return value of register_shrinker
@ 2017-11-24 20:18 Michael Lyle
  2017-11-24 22:02 ` [PATCH v2] " Michael Lyle
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Lyle @ 2017-11-24 20:18 UTC (permalink / raw)
  To: linux-bcache; +Cc: Michael Lyle

This is now __must_check, so this kills a warning.  Caller of
bch_btree_cache_alloc in super.c appropriately checks return value
so this is fully plumbed through.

Signed-off-by: Michael Lyle <mlyle@lyle.org>
---
 drivers/md/bcache/btree.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 11c5503d31dc..0c2b77e0194b 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: bch_btree_cache_alloc: could not register shrinker");
+	}
 
 	return 0;
 }
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-24 23:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-24 20:18 [PATCH] bcache: check return value of register_shrinker Michael Lyle
2017-11-24 22:02 ` [PATCH v2] " Michael Lyle
2017-11-24 22:24   ` Michael Lyle
2017-11-24 22:35     ` Vojtech Pavlik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.