bcachefs: Fix accounting replay flags
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 12 Oct 2024 06:44:38 +0000 (02:44 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 12 Oct 2024 07:02:16 +0000 (03:02 -0400)
BCH_TRANS_COMMIT_journal_reclaim without BCH_WATERMARK_reclaim means
"return an error if low on journal space" - but accounting replay must
succeed.

Fixes https://github.com/koverstreet/bcachefs/issues/656

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

index 6db72d3bad7db76bb5908d99c8b0a98236462cdd..55e1504a813000e3e863467cf6557669fec4541a 100644 (file)
@@ -287,7 +287,8 @@ int bch2_journal_replay(struct bch_fs *c)
                                BCH_TRANS_COMMIT_no_enospc|
                                BCH_TRANS_COMMIT_journal_reclaim|
                                BCH_TRANS_COMMIT_skip_accounting_apply|
-                               BCH_TRANS_COMMIT_no_journal_res,
+                               BCH_TRANS_COMMIT_no_journal_res|
+                               BCH_WATERMARK_reclaim,
                             bch2_journal_replay_accounting_key(trans, k));
                if (bch2_fs_fatal_err_on(ret, c, "error replaying accounting; %s", bch2_err_str(ret)))
                        goto err;