]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bcachefs: print sb magic when relevant
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 5 Jan 2024 18:03:01 +0000 (13:03 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 6 Jan 2024 04:24:21 +0000 (23:24 -0500)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super-io.c

index ea86921727b4e5abd34540c028979b76dda99434..b05c5f1fe09d3d6570469ad6ae85792ae5bb048f 100644 (file)
@@ -628,7 +628,9 @@ reread:
 
        if (!uuid_equal(&sb->sb->magic, &BCACHE_MAGIC) &&
            !uuid_equal(&sb->sb->magic, &BCHFS_MAGIC)) {
-               prt_printf(err, "Not a bcachefs superblock");
+               prt_str(err, "Not a bcachefs superblock (got magic ");
+               pr_uuid(err, sb->sb->magic.b);
+               prt_str(err, ")");
                return -BCH_ERR_invalid_sb_magic;
        }
 
@@ -1261,6 +1263,11 @@ void bch2_sb_to_text(struct printbuf *out, struct bch_sb *sb,
        pr_uuid(out, sb->uuid.b);
        prt_newline(out);
 
+       prt_printf(out, "Magic number:");
+       prt_tab(out);
+       pr_uuid(out, sb->magic.b);
+       prt_newline(out);
+
        prt_str(out, "Device index:");
        prt_tab(out);
        prt_printf(out, "%u", sb->dev_idx);