diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-06 00:23:44 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-06 05:24:21 +0100 |
commit | 72e2c920e4dcf73d37e513d404fa561c7b6f5ebc (patch) | |
tree | 7dfee546726772e7cb0dcbcaed4c82c5d225e7e3 /fs | |
parent | bcachefs: bch2_dump_bset() doesn't choke on u64s == 0 (diff) | |
download | linux-72e2c920e4dcf73d37e513d404fa561c7b6f5ebc.tar.xz linux-72e2c920e4dcf73d37e513d404fa561c7b6f5ebc.zip |
bcachefs: Restart recovery passes more reliably
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/recovery.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index e1f0da6a717e..725214605a05 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -696,8 +696,11 @@ static int bch2_run_recovery_passes(struct bch_fs *c) while (c->curr_recovery_pass < ARRAY_SIZE(recovery_pass_fns)) { if (should_run_recovery_pass(c, c->curr_recovery_pass)) { + unsigned pass = c->curr_recovery_pass; + ret = bch2_run_recovery_pass(c, c->curr_recovery_pass); - if (bch2_err_matches(ret, BCH_ERR_restart_recovery)) + if (bch2_err_matches(ret, BCH_ERR_restart_recovery) || + (ret && c->curr_recovery_pass < pass)) continue; if (ret) break; |