From: Tang Junhui Date: Mon, 19 Mar 2018 00:36:21 +0000 (-0700) Subject: bcache: fix error return value in memory shrink X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=f3641c3abd1da978ee969b0203b71b86ec1bfa93;p=openwrt%2Fstaging%2Fblogic.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 39cc8a549091..b2d4899f48d5 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,