summaryrefslogtreecommitdiff
path: root/fs/bcachefs/error.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-12-07 21:36:15 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-12-21 01:36:22 -0500
commit60558d55f7e26c8aa2242718461642792fa200a4 (patch)
tree3c00f7b2e9ba0d2de21e48cd1c28914b89c95b78 /fs/bcachefs/error.c
parentbbe36bd0993df2167b883d4af0b849a309350c38 (diff)
bcachefs: Plumb bkey_validate_context to journal_entry_validate
This lets us print the exact location in the journal if it was found in the journal, or correctly print if it was found in the superblock. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r--fs/bcachefs/error.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c
index 9e34374960f3..038da6a61f6b 100644
--- a/fs/bcachefs/error.c
+++ b/fs/bcachefs/error.c
@@ -486,9 +486,14 @@ int __bch2_bkey_fsck_err(struct bch_fs *c,
fsck_flags |= fsck_flags_extra[err];
struct printbuf buf = PRINTBUF;
-
- prt_printf(&buf, "invalid bkey in %s btree=",
+ prt_printf(&buf, "invalid bkey in %s",
bch2_bkey_validate_contexts[from.from]);
+
+ if (from.from == BKEY_VALIDATE_journal)
+ prt_printf(&buf, " journal seq=%llu offset=%u",
+ from.journal_seq, from.journal_offset);
+
+ prt_str(&buf, " btree=");
bch2_btree_id_to_text(&buf, from.btree);
prt_printf(&buf, " level=%u: ", from.level);