Skip to content

Commit 114f530

Browse files
Hongbo LiKent Overstreet
authored andcommitted
bcachefs: show none if label is not set
If label is not set, the Label tag in superblock info show '(none)'. ``` [Before] Device index: 0 Label: Version: 1.4: member_seq [After] Device index: 0 Label: (none) Version: 1.4: member_seq ``` Signed-off-by: Hongbo Li <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent 7b6dda7 commit 114f530

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/bcachefs/super-io.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,10 @@ void bch2_sb_to_text(struct printbuf *out, struct bch_sb *sb,
13121312
prt_printf(out, "Device index:\t%u\n", sb->dev_idx);
13131313

13141314
prt_printf(out, "Label:\t");
1315-
prt_printf(out, "%.*s", (int) sizeof(sb->label), sb->label);
1315+
if (!strlen(sb->label))
1316+
prt_printf(out, "(none)");
1317+
else
1318+
prt_printf(out, "%.*s", (int) sizeof(sb->label), sb->label);
13161319
prt_newline(out);
13171320

13181321
prt_printf(out, "Version:\t");

0 commit comments

Comments
 (0)