summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-07-20 15:51:05 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:42 -0400
commitf621e1521c3ff5ea295a97d7d71cdbe84f496467 (patch)
tree2edbfcb85c5d74f735ef81c60a537da0d9a42aab /fs/bcachefs/recovery.c
parente6d1161530bcd632ad10b6aa0ad511abb146dbcc (diff)
downloadlwn-f621e1521c3ff5ea295a97d7d71cdbe84f496467.tar.gz
lwn-f621e1521c3ff5ea295a97d7d71cdbe84f496467.zip
bcachefs: Add an option for rebuilding the replicas section
There is a bug where we cnan end up clearing the data_has field in the superblock members section, which causes us to skip reading the journal and thus journal replay fails. This option tells the recovery path to not trust those fields. 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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index 1695a609ecd9..28972f30e198 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -974,7 +974,8 @@ 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->replicas.entries) {
+ if (!c->replicas.entries ||
+ c->opts.rebuild_replicas) {
bch_info(c, "building replicas info");
set_bit(BCH_FS_REBUILD_REPLICAS, &c->flags);
}