From: Guoju Fang Date: Wed, 24 Apr 2019 16:48:27 +0000 (+0800) Subject: bcache: fix inaccurate result of unused buckets X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4e0c04ec3a304490a83d5c0355e64176acc9b4ba;p=linux.git bcache: fix inaccurate result of unused buckets To get the amount of unused buckets in sysfs_priority_stats, the code count the buckets which GC_SECTORS_USED is zero. It's correct and should not be overwritten by the count of buckets which prio is zero. Signed-off-by: Guoju Fang Signed-off-by: Coly Li Signed-off-by: Jens Axboe --- diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 17bae9c14ca0a..6cd44d3cf906a 100644 --- a/drivers/md/bcache/sysfs.c +++ b/drivers/md/bcache/sysfs.c @@ -996,8 +996,6 @@ SHOW(__bch_cache) !cached[n - 1]) --n; - unused = ca->sb.nbuckets - n; - while (cached < p + n && *cached == BTREE_PRIO) cached++, n--;