mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
bcachefs: Upgrading uses bch_sb.recovery_passes_required
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
96f37eabe7
commit
eff1f728be
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user