Skip to content

Commit c3dd253

Browse files
author
Kent Overstreet
committed
bcachefs: Don't pass trans to fsck_err() in gc_accounting_done
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 <[email protected]>
1 parent 9e48f57 commit c3dd253

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/bcachefs/disk_accounting.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,9 @@ int bch2_gc_accounting_done(struct bch_fs *c)
618618
for (unsigned j = 0; j < nr; j++)
619619
src_v[j] -= dst_v[j];
620620

621-
if (fsck_err(trans, accounting_mismatch, "%s", buf.buf)) {
621+
bch2_trans_unlock_long(trans);
622+
623+
if (fsck_err(c, accounting_mismatch, "%s", buf.buf)) {
622624
percpu_up_write(&c->mark_lock);
623625
ret = commit_do(trans, NULL, NULL, 0,
624626
bch2_disk_accounting_mod(trans, &acc_k, src_v, nr, false));

0 commit comments

Comments
 (0)