bcachefs: Fix journal replay when replicas sb section missing
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 4 Nov 2018 01:51:31 +0000 (21:51 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:11 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal_io.c

index 0bcc4346285cf2f9fa9512142f814bab75f9b12c..eb2fbe2354831c3319b4f132c67aad1f7b548f50 100644 (file)
@@ -746,7 +746,8 @@ int bch2_journal_read(struct bch_fs *c, struct list_head *list)
        jlist.ret = 0;
 
        for_each_member_device(ca, c, iter) {
-               if (!(bch2_dev_has_data(c, ca) & (1 << BCH_DATA_JOURNAL)))
+               if (!test_bit(BCH_FS_REBUILD_REPLICAS, &c->flags) &&
+                   !(bch2_dev_has_data(c, ca) & (1 << BCH_DATA_JOURNAL)))
                        continue;
 
                if ((ca->mi.state == BCH_MEMBER_STATE_RW ||