]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Also log device name in userspace
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 15 Nov 2021 20:03:06 +0000 (15:03 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:17 +0000 (17:09 -0400)
Change log messages in userspace to be closer to what they are in kernel
space, and include the device name - it's also useful in userspace.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/bcachefs.h
fs/bcachefs/recovery.c

index 5672700150081b7040788e6ba2f5c75d51788fef..966e185201d1fcc8ac60dfb12992fc6b40c3c748 100644 (file)
 #define bch2_fmt(_c, fmt)              "bcachefs (%s): " fmt "\n", ((_c)->name)
 #define bch2_fmt_inum(_c, _inum, fmt)  "bcachefs (%s inum %llu): " fmt "\n", ((_c)->name), (_inum)
 #else
-#define bch2_fmt(_c, fmt)              fmt "\n"
-#define bch2_fmt_inum(_c, _inum, fmt)  "inum %llu: " fmt "\n", (_inum)
+#define bch2_fmt(_c, fmt)              "%s: " fmt "\n", ((_c)->name)
+#define bch2_fmt_inum(_c, _inum, fmt)  "%s inum %llu: " fmt "\n", ((_c)->name), (_inum)
 #endif
 
 #define bch_info(c, fmt, ...) \
index 373e309299bbe513eac45fcec56ec1c69c9a94d9..be89126055271a6a6644a734580f55cb5af22ce5 100644 (file)
@@ -1031,6 +1031,8 @@ int bch2_fs_recovery(struct bch_fs *c)
        if (c->sb.clean)
                bch_info(c, "recovering from clean shutdown, journal seq %llu",
                         le64_to_cpu(clean->journal_seq));
+       else
+               bch_info(c, "recovering from unclean shutdown");
 
        if (!(c->sb.features & (1ULL << BCH_FEATURE_new_extent_overwrite))) {
                bch_err(c, "feature new_extent_overwrite not set, filesystem no longer supported");
@@ -1049,7 +1051,6 @@ int bch2_fs_recovery(struct bch_fs *c)
                bch_err(c, "filesystem may have incompatible bkey formats; run fsck from the compat branch to fix");
                ret = -EINVAL;
                goto err;
-
        }
 
        if (!(c->sb.features & (1ULL << BCH_FEATURE_alloc_v2))) {