Commit a2b5313a authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix a faulty assertion

Now that updates to interior nodes are journalled, we shouldn't be
checking topology of interior nodes until we've finished replaying
updates to that node.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent e8306e3b
......@@ -26,7 +26,7 @@
/*
* Verify that child nodes correctly span parent node's range:
*/
static void btree_node_interior_verify(struct btree *b)
static void btree_node_interior_verify(struct bch_fs *c, struct btree *b)
{
#ifdef CONFIG_BCACHEFS_DEBUG
struct bpos next_node = b->data->min_key;
......@@ -37,6 +37,9 @@ static void btree_node_interior_verify(struct btree *b)
BUG_ON(!b->c.level);
if (!test_bit(BCH_FS_BTREE_INTERIOR_REPLAY_DONE, &c->flags))
return;
bch2_btree_node_iter_init_from_start(&iter, b);
while (1) {
......@@ -1120,8 +1123,8 @@ static struct btree *__btree_split_node(struct btree_update *as,
bch2_verify_btree_nr_keys(n2);
if (n1->c.level) {
btree_node_interior_verify(n1);
btree_node_interior_verify(n2);
btree_node_interior_verify(as->c, n1);
btree_node_interior_verify(as->c, n2);
}
return n2;
......@@ -1180,7 +1183,7 @@ static void btree_split_insert_keys(struct btree_update *as, struct btree *b,
BUG_ON(b->nsets != 1 ||
b->nr.live_u64s != le16_to_cpu(btree_bset_first(b)->u64s));
btree_node_interior_verify(b);
btree_node_interior_verify(as->c, b);
}
static void btree_split(struct btree_update *as, struct btree *b,
......@@ -1378,7 +1381,7 @@ void bch2_btree_insert_node(struct btree_update *as, struct btree *b,
bch2_btree_node_unlock_write(b, iter);
btree_node_interior_verify(b);
btree_node_interior_verify(c, b);
/*
* when called from the btree_split path the new nodes aren't added to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment