bcachefs: Don't rewind to run a recovery pass we already ran

Fix a small regression from the "run recovery passes" rewrite, which
enabled async recovery passes.

This fixes getting stuck in a loop in recovery.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
pull/1256/head
Kent Overstreet 2025-05-26 11:12:53 -04:00
parent 686db67a8e
commit 72ab5136e8
1 changed files with 3 additions and 1 deletions

View File

@ -315,7 +315,9 @@ int __bch2_run_explicit_recovery_pass(struct bch_fs *c,
goto out;
bool in_recovery = test_bit(BCH_FS_in_recovery, &c->flags);
bool rewind = in_recovery && r->curr_pass > pass;
bool rewind = in_recovery &&
r->curr_pass > pass &&
!(r->passes_complete & BIT_ULL(pass));
bool ratelimit = flags & RUN_RECOVERY_PASS_ratelimit;
if (!(in_recovery && (flags & RUN_RECOVERY_PASS_nopersistent))) {