Commit dc7a15fb authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Skip deleted members in member_to_text()

This fixes show-super output - we shouldn't be printing members that
have been deleted.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent df94cb2e
...@@ -168,6 +168,9 @@ static void member_to_text(struct printbuf *out, ...@@ -168,6 +168,9 @@ static void member_to_text(struct printbuf *out,
u64 bucket_size = le16_to_cpu(m.bucket_size); u64 bucket_size = le16_to_cpu(m.bucket_size);
u64 device_size = le64_to_cpu(m.nbuckets) * bucket_size; u64 device_size = le64_to_cpu(m.nbuckets) * bucket_size;
if (!bch2_member_exists(&m))
return;
prt_printf(out, "Device:"); prt_printf(out, "Device:");
prt_tab(out); prt_tab(out);
prt_printf(out, "%u", i); prt_printf(out, "%u", i);
...@@ -304,10 +307,8 @@ static void bch2_sb_members_v1_to_text(struct printbuf *out, struct bch_sb *sb, ...@@ -304,10 +307,8 @@ static void bch2_sb_members_v1_to_text(struct printbuf *out, struct bch_sb *sb,
struct bch_sb_field_disk_groups *gi = bch2_sb_field_get(sb, disk_groups); struct bch_sb_field_disk_groups *gi = bch2_sb_field_get(sb, disk_groups);
unsigned i; unsigned i;
for (i = 0; i < sb->nr_devices; i++) { for (i = 0; i < sb->nr_devices; i++)
struct bch_member m = members_v1_get(mi, i); member_to_text(out, members_v1_get(mi, i), gi, sb, i);
member_to_text(out, m, gi, sb, i);
}
} }
const struct bch_sb_field_ops bch_sb_field_ops_members_v1 = { const struct bch_sb_field_ops bch_sb_field_ops_members_v1 = {
...@@ -322,10 +323,8 @@ static void bch2_sb_members_v2_to_text(struct printbuf *out, struct bch_sb *sb, ...@@ -322,10 +323,8 @@ static void bch2_sb_members_v2_to_text(struct printbuf *out, struct bch_sb *sb,
struct bch_sb_field_disk_groups *gi = bch2_sb_field_get(sb, disk_groups); struct bch_sb_field_disk_groups *gi = bch2_sb_field_get(sb, disk_groups);
unsigned i; unsigned i;
for (i = 0; i < sb->nr_devices; i++) { for (i = 0; i < sb->nr_devices; i++)
struct bch_member m = members_v2_get(mi, i); member_to_text(out, members_v2_get(mi, i), gi, sb, i);
member_to_text(out, m, gi, sb, i);
}
} }
static int bch2_sb_members_v2_validate(struct bch_sb *sb, static int bch2_sb_members_v2_validate(struct bch_sb *sb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment