bcachefs: Fix opts.recovery_pass_last
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 23 May 2025 22:31:53 +0000 (18:31 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 23 May 2025 23:52:31 +0000 (19:52 -0400)
This was lost in the giant recovery pass rework - but it's used heavily
by bcachefs subcommand utilities.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/recovery_passes.c

index f74f14227137b0e8e75f9f9d95d925ca7fcc8830..dabb29b08ad0a83f0c2ddb5c359bc3c896bb012c 100644 (file)
@@ -525,6 +525,9 @@ int bch2_run_recovery_passes(struct bch_fs *c, enum bch_recovery_pass from)
                c->opts.recovery_passes |
                c->sb.recovery_passes_required;
 
+       if (c->opts.recovery_pass_last)
+               passes &= BIT_ULL(c->opts.recovery_pass_last + 1) - 1;
+
        /*
         * We can't allow set_may_go_rw to be excluded; that would cause us to
         * use the journal replay keys for updates where it's not expected.