From 06c8b3dd639430cfb4999be19b8554bafd55940d Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 6 Aug 2025 13:09:03 -0400 Subject: [PATCH] cmd_fs_usage: BCH_DATA_unstriped isn't a real bucket type BCH_DATA_unstriped tracks unstriped data in stripe member buckets, it double counts a portion of BCH_DATA_stripe. Signed-off-by: Kent Overstreet --- c_src/cmd_fs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/c_src/cmd_fs.c b/c_src/cmd_fs.c index 4eca866a..d13c7e71 100644 --- a/c_src/cmd_fs.c +++ b/c_src/cmd_fs.c @@ -52,10 +52,9 @@ static void dev_usage_to_text(struct printbuf *out, struct bch_ioctl_dev_usage_v2 *u = bchu_dev_usage(fs, d->idx); u64 used = 0, capacity = u->nr_buckets * u->bucket_size; - for (unsigned type = 0; type < u->nr_data_types; type++) { - if (!data_type_is_empty(type)) + for (unsigned type = 0; type < u->nr_data_types; type++) + if (type != BCH_DATA_unstriped) used += u->d[type].sectors; - } prt_printf(out, "%s (device %u):\t%s\r%s\r %02u%%\n", d->label ?: "(no label)", d->idx,