From eff1f728bedc014c783752af5d2a88c46586f654 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 29 Dec 2023 17:08:58 -0500 Subject: bcachefs: Upgrading uses bch_sb.recovery_passes_required Signed-off-by: Kent Overstreet --- fs/bcachefs/recovery.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'fs') diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index d2914e911461..066aef6f3c74 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -575,7 +575,7 @@ u64 bch2_recovery_passes_from_stable(u64 v) return ret; } -static bool check_version_upgrade(struct bch_fs *c) +static u64 check_version_upgrade(struct bch_fs *c) { unsigned latest_compatible = bch2_latest_compatible_version(c->sb.version); unsigned latest_version = bcachefs_metadata_version_current; @@ -626,14 +626,12 @@ static bool check_version_upgrade(struct bch_fs *c) u64 recovery_passes = bch2_upgrade_recovery_passes(c, old_version, new_version); if (recovery_passes) { - if ((recovery_passes & RECOVERY_PASS_ALL_FSCK) == RECOVERY_PASS_ALL_FSCK) - prt_str(&buf, "fsck required"); - else { - prt_str(&buf, "running recovery passes: "); - prt_bitflags(&buf, bch2_recovery_passes, recovery_passes); - } + prt_str(&buf, " running recovery passes: "); + prt_bitflags(&buf, bch2_recovery_passes, recovery_passes); - c->recovery_passes_explicit |= recovery_passes; + struct bch_sb_field_ext *ext = bch2_sb_field_get(c->disk_sb.sb, ext); + ext->recovery_passes_required[0] |= + cpu_to_le64(bch2_recovery_passes_to_stable(recovery_passes)); c->opts.fix_errors = FSCK_FIX_yes; } -- cgit v1.2.3