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: Kent Overstreet <kent.overstreet@gmail.com>
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);