Skip to content

Commit 7de3c8b

Browse files
author
Kent Overstreet
committed
bcachefs: Don't schedule non persistent passes persistently
if (!(in_recovery && (flags & RUN_RECOVERY_PASS_nopersistent))) should have been if (!in_recovery && !(flags & RUN_RECOVERY_PASS_nopersistent))) But the !in_recovery part was also wrong: the assumption is that if we're in recovery we'll just rewind and run the recovery pass immediately, but we're not able to do so if we've already gone RW and the pass must be run before we go RW. In that case, we need to schedule it in the superblock so it can be run on the next mount attempt. Scheduling it persistently is fine, because it'll be cleared in the superblock immediately when the pass completes successfully. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 63a8346 commit 7de3c8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/bcachefs/recovery_passes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ int __bch2_run_explicit_recovery_pass(struct bch_fs *c,
360360
!(r->passes_complete & BIT_ULL(pass));
361361
bool ratelimit = flags & RUN_RECOVERY_PASS_ratelimit;
362362

363-
if (!(in_recovery && (flags & RUN_RECOVERY_PASS_nopersistent))) {
363+
if (!(flags & RUN_RECOVERY_PASS_nopersistent)) {
364364
struct bch_sb_field_ext *ext = bch2_sb_field_get(c->disk_sb.sb, ext);
365365
__set_bit_le64(bch2_recovery_pass_to_stable(pass), ext->recovery_passes_required);
366366
}

0 commit comments

Comments
 (0)