cmd_show_super: Fix ghost devices in the output

Fixes https://github.com/koverstreet/bcachefs/issues/942.
Fixes: 6704e252 ("cmd_show_super: Look up and print names of member devices")

Signed-off-by: Nikita Ofitserov <himikof@gmail.com>
This commit is contained in:
Nikita Ofitserov 2025-09-28 03:27:39 +03:00
parent 0a1ad84c02
commit fe26d257a8

View File

@ -58,6 +58,9 @@ static void print_one_member(struct printbuf *out, sb_names sb_names,
struct bch_sb_field_disk_groups *gi,
struct bch_member m, unsigned idx)
{
if (!bch2_member_alive(&m))
return;
struct sb_name *name = sb_dev_to_name(sb_names, idx);
prt_printf(out, "Device %u:\t%s\t", idx, name ? name->name : "(not found)");