summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-10 12:42:49 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 11:47:41 -0500
commit249bf593e84e0b4652d2cdb9884b97bc21b59d9f (patch)
treeef99bec99fd8a28c3fdc1338ffec3bc0bd501a8b /fs/bcachefs/recovery.c
parentb56cee70e75e2edcbb92eb3d9357fae5df857b01 (diff)
bcachefs: Fix snapshot.c assertion for online fsck
c->curr_recovery_pass can go backwards; this adds a non rewinding version, c->recovery_pass_done. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index ed366b35a1f2..1099b2f51252 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -713,6 +713,7 @@ static int bch2_run_recovery_passes(struct bch_fs *c)
c->recovery_passes_complete |= BIT_ULL(c->curr_recovery_pass);
}
c->curr_recovery_pass++;
+ c->recovery_pass_done = max(c->recovery_pass_done, c->curr_recovery_pass);
}
return ret;
@@ -1197,6 +1198,8 @@ int bch2_fs_initialize(struct bch_fs *c)
goto err;
}
+ c->recovery_pass_done = ARRAY_SIZE(recovery_pass_fns) - 1;
+
if (enabled_qtypes(c)) {
ret = bch2_fs_quota_read(c);
if (ret)