Skip to contentSkip to conversation

bcache: fix inaccurate result of unused buckets

PATCH New Guoju Fang 1 participant 1 message Mar 5, 2019

Subsystems (2)
lore
Share & tools
lore

Guoju Fang

author
#0 lore raw

PATCH 2/2 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.

---
 drivers/md/bcache/sysfs.c | 2 --
 1 file changed, 2 deletions(-)
drivers/md/bcache/sysfs.c +0 -2
index 557a8a3..b31c9df 100644
@@ -959,8 +959,6 @@ static int __bch_cache_cmp(const void *l, const void *r)
 		       !cached[n - 1])
 			--n;
 
-		unused = ca->sb.nbuckets - n;
-
 		while (cached < p + n &&
 		       *cached == BTREE_PRIO)
 			cached++, n--;
Signature · 1 line
1.8.3.1