From: Kent Overstreet Date: Sat, 10 May 2025 21:19:05 +0000 (-0400) Subject: bcachefs: Don't rewind recovery if not in recovery X-Git-Tag: v6.16-rc1~211^2~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=177ac4925f4cbcfb672cb46f1d443a3d6c8a4b11;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Don't rewind recovery if not in recovery Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/recovery_passes.c b/fs/bcachefs/recovery_passes.c index 5f2bd8c10ce62..22cefffcf1fa7 100644 --- a/fs/bcachefs/recovery_passes.c +++ b/fs/bcachefs/recovery_passes.c @@ -233,7 +233,8 @@ static int __bch2_run_explicit_recovery_pass(struct printbuf *out, c->opts.recovery_passes |= BIT_ULL(pass); - if (c->curr_recovery_pass > pass) { + if (test_bit(BCH_FS_in_recovery, &c->flags) && + c->curr_recovery_pass > pass) { c->next_recovery_pass = pass; c->recovery_passes_complete &= (1ULL << pass) >> 1; return -BCH_ERR_restart_recovery;