bcachefs: Log fsck errors in the journal
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 1 Jun 2025 17:07:31 +0000 (13:07 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 12 Jun 2025 03:21:29 +0000 (23:21 -0400)
Log the specific error being corrected in the journal when we're
repairing, this helps greatly with 'bcachefs list_journal' analysis.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/error.c

index 63951e293c47a7ff06de8e5566b8ea026d230f38..ff49cebfd0e8d1ad25c5c14041c436a02642bfe9 100644 (file)
@@ -620,6 +620,9 @@ print:
 
        if (s)
                s->ret = ret;
+
+       if (trans)
+               ret = bch2_trans_log_str(trans, bch2_sb_error_strs[err]) ?: ret;
 err_unlock:
        mutex_unlock(&c->fsck_error_msgs_lock);
 err: