summaryrefslogtreecommitdiff
path: root/libbcachefs/recovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbcachefs/recovery.c')
-rw-r--r--libbcachefs/recovery.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libbcachefs/recovery.c b/libbcachefs/recovery.c
index 63b385d8..dcd4f9f4 100644
--- a/libbcachefs/recovery.c
+++ b/libbcachefs/recovery.c
@@ -1262,20 +1262,16 @@ static int bch2_run_recovery_pass(struct bch_fs *c, enum bch_recovery_pass pass)
static int bch2_run_recovery_passes(struct bch_fs *c)
{
int ret = 0;
-again:
+
while (c->curr_recovery_pass < ARRAY_SIZE(recovery_passes)) {
ret = bch2_run_recovery_pass(c, c->curr_recovery_pass);
+ if (bch2_err_matches(ret, BCH_ERR_restart_recovery))
+ continue;
if (ret)
break;
c->curr_recovery_pass++;
}
- if (bch2_err_matches(ret, BCH_ERR_need_snapshot_cleanup)) {
- set_bit(BCH_FS_HAVE_DELETED_SNAPSHOTS, &c->flags);
- c->curr_recovery_pass = BCH_RECOVERY_PASS_delete_dead_snapshots;
- goto again;
- }
-
return ret;
}
@@ -1453,6 +1449,11 @@ use_clean:
if (ret)
goto err;
+ if (c->opts.fsck &&
+ (IS_ENABLED(CONFIG_BCACHEFS_DEBUG) ||
+ BCH_SB_HAS_TOPOLOGY_ERRORS(c->disk_sb.sb)))
+ c->recovery_passes_explicit |= BIT_ULL(BCH_RECOVERY_PASS_check_topology);
+
ret = bch2_run_recovery_passes(c);
if (ret)
goto err;