
From: Guoju Fang <fangguoju@gmail.com> mainline inclusion from mainline-5.2-rc1 commit 4e0c04ec3a304490a83d5c0355e64176acc9b4ba category: backport 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 <fangguoju@gmail.com> Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> --- drivers/md/bcache/sysfs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c index 3ae271f95ffe..d0b1ebf4eb56 100644 --- a/drivers/md/bcache/sysfs.c +++ b/drivers/md/bcache/sysfs.c @@ -1001,8 +1001,6 @@ SHOW(__bch_cache) !cached[n - 1]) --n; - unused = ca->sb.nbuckets - n; - while (cached < p + n && *cached == BTREE_PRIO) cached++, n--; -- 2.16.4