bcachefs: Don't repair btree nodes until after interior journal replay is done
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 21 May 2021 20:06:54 +0000 (16:06 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:04 +0000 (17:09 -0400)
We need the btree to be in a consistent state before we can rewrite
btree nodes.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_update_interior.c

index ea1b09b36059196e8a1436320de86165aac8085d..1f14f3e56aefac1c23910028acbbbbd99c87138b 100644 (file)
@@ -1828,6 +1828,9 @@ void bch2_btree_node_rewrite_async(struct bch_fs *c, struct btree *b)
 {
        struct async_btree_rewrite *a;
 
+       if (!test_bit(BCH_FS_BTREE_INTERIOR_REPLAY_DONE, &c->flags))
+               return;
+
        if (!percpu_ref_tryget(&c->writes))
                return;