bcachefs: print label correctly in sb_member_to_text()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-05-09 23:15:40 -04:00
parent 13ffcbae86
commit 3b7b0c3996

View File

@ -222,17 +222,11 @@ static void member_to_text(struct printbuf *out,
printbuf_indent_add(out, 2);
prt_printf(out, "Label:\t");
if (BCH_MEMBER_GROUP(&m)) {
unsigned idx = BCH_MEMBER_GROUP(&m) - 1;
if (idx < disk_groups_nr(gi))
prt_printf(out, "%s (%u)",
gi->entries[idx].label, idx);
else
prt_printf(out, "(bad disk labels section)");
} else {
if (BCH_MEMBER_GROUP(&m))
bch2_disk_path_to_text_sb(out, sb,
BCH_MEMBER_GROUP(&m) - 1);
else
prt_printf(out, "(none)");
}
prt_newline(out);
prt_printf(out, "UUID:\t");