diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-05 18:23:44 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-05 23:24:21 -0500 |
commit | 72e2c920e4dcf73d37e513d404fa561c7b6f5ebc (patch) | |
tree | 7dfee546726772e7cb0dcbcaed4c82c5d225e7e3 /fs/bcachefs/recovery.c | |
parent | d04d2727438575e1884ccd4a2eff34f5ee5acedd (diff) | |
download | linux-72e2c920e4dcf73d37e513d404fa561c7b6f5ebc.tar.gz linux-72e2c920e4dcf73d37e513d404fa561c7b6f5ebc.tar.bz2 linux-72e2c920e4dcf73d37e513d404fa561c7b6f5ebc.zip |
bcachefs: Restart recovery passes more reliably
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-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; |