From: Tang Junhui Date: Mon, 19 Mar 2018 00:36:21 +0000 (-0700) Subject: bcache: fix error return value in memory shrink X-Git-Tag: v5.15~9111^2~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3641c3abd1da978ee969b0203b71b86ec1bfa93;p=platform%2Fkernel%2Flinux-starfive.git bcache: fix error return value in memory shrink In bch_mca_scan(), the return value should not be the number of freed btree nodes, but the number of pages of freed btree nodes. Signed-off-by: Tang Junhui Reviewed-by: Michael Lyle Signed-off-by: Jens Axboe --- diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 39cc8a5..b2d4899 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -719,7 +719,7 @@ static unsigned long bch_mca_scan(struct shrinker *shrink, } out: mutex_unlock(&c->bucket_lock); - return freed; + return freed * c->btree_pages; } static unsigned long bch_mca_count(struct shrinker *shrink,