bcachefs: Don't pass trans to fsck_err() in gc_accounting_done
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 9 Jun 2025 21:28:00 +0000 (17:28 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 12 Jun 2025 03:21:30 +0000 (23:21 -0400)
fsck_err() can return a transaction restart if passed a transaction
object - this has always been true when it has to drop locks to prompt
for user input, but we're seeing this more now that we're logging the
error being corrected in the journal.

gc_accounting_done() doesn't call fsck_err() from an actual commit loop,
and it doesn't need to be holding btree locks when it calls fsck_err(),
so the easy fix here for the unhandled transaction restart is to just
not pass it the transaction object. We'll miss out on the fancy new
logging, but that's ok.

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

index 3d59a57a52566915751e09f363a1bc5e8feaa018..f7528cd69c73fee4efcbfbf8367ebd0a9606f320 100644 (file)
@@ -618,7 +618,9 @@ int bch2_gc_accounting_done(struct bch_fs *c)
                        for (unsigned j = 0; j < nr; j++)
                                src_v[j] -= dst_v[j];
 
-                       if (fsck_err(trans, accounting_mismatch, "%s", buf.buf)) {
+                       bch2_trans_unlock_long(trans);
+
+                       if (fsck_err(c, accounting_mismatch, "%s", buf.buf)) {
                                percpu_up_write(&c->mark_lock);
                                ret = commit_do(trans, NULL, NULL, 0,
                                                bch2_disk_accounting_mod(trans, &acc_k, src_v, nr, false));