Commit 71ed0056 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix an assertion

We can end up in a strange situation where a btree_path points to a node
being freed even after pointers to it should have been replaced by
pointers to the new node - if the btree node has been reused since the
pointer to it was created.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 42d23732
......@@ -165,7 +165,8 @@ static void bch2_btree_node_free_inmem(struct btree_trans *trans,
struct btree_path *path;
trans_for_each_path(trans, path)
BUG_ON(path->l[b->c.level].b == b);
BUG_ON(path->l[b->c.level].b == b &&
path->l[b->c.level].lock_seq == b->c.lock.state.seq);
six_lock_write(&b->c.lock, NULL, NULL);
......
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