diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-02-03 15:31:17 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:53 -0400 |
commit | 5d428c7c6445fc483f77eef82d17a744eeed73be (patch) | |
tree | d36ea93c1e9d6d96f41127dc9e9564e116a69339 /fs/bcachefs/recovery.c | |
parent | 4b8f89afd44592d50f7309750e7835fc777dfb08 (diff) | |
download | lwn-5d428c7c6445fc483f77eef82d17a744eeed73be.tar.gz lwn-5d428c7c6445fc483f77eef82d17a744eeed73be.zip |
bcachefs: Run fsck if BCH_FEATURE_alloc_v2 isn't set
We're using BCH_FEATURE_alloc_v2 to also gate journalling updates to dev
usage - we don't have the code for reconstructing this from buckets
anymore, so we need to run fsck if it's not set.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r-- | fs/bcachefs/recovery.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index 7ba098adcab9..8560023b4c7a 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -1088,6 +1088,13 @@ int bch2_fs_recovery(struct bch_fs *c) bch_info(c, "recovering from clean shutdown, journal seq %llu", le64_to_cpu(clean->journal_seq)); + if (!(c->sb.features & (1ULL << BCH_FEATURE_alloc_v2))) { + bch_info(c, "alloc_v2 feature bit not set, fsck required"); + c->opts.fsck = true; + c->opts.fix_errors = FSCK_OPT_YES; + c->disk_sb.sb->features[0] |= 1ULL << BCH_FEATURE_alloc_v2; + } + if (!c->replicas.entries || c->opts.rebuild_replicas) { bch_info(c, "building replicas info"); |