summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorTang Junhui <tang.junhui@zte.com.cn>2018-03-19 01:36:21 +0100
committerJens Axboe <axboe@kernel.dk>2018-03-19 03:15:20 +0100
commitf3641c3abd1da978ee969b0203b71b86ec1bfa93 (patch)
tree8670c8088ec6c0f3b1f2fd6b5fb6f0afa3f16872 /drivers/md
parentbcache: fix incorrect sysfs output value of strip size (diff)
downloadlinux-f3641c3abd1da978ee969b0203b71b86ec1bfa93.tar.xz
linux-f3641c3abd1da978ee969b0203b71b86ec1bfa93.zip
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 <tang.junhui@zte.com.cn> Reviewed-by: Michael Lyle <mlyle@lyle.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bcache/btree.c2
1 files changed, 1 insertions, 1 deletions
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,