Skip to content

Commit 6adc5af

Browse files
author
Kent Overstreet
committed
bcachefs: btree_path_very_locks(): verify lock seq
If the btree_path's lock seq is wrong, the next bch2_trans_relock() operation is guaranteed to fail and we take an unnecessary transaction restart. Signed-off-by: Kent Overstreet <[email protected]>
1 parent f908eac commit 6adc5af

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/bcachefs/btree_locking.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,9 @@ void bch2_btree_path_verify_locks(struct btree_path *path)
856856
(want == BTREE_NODE_UNLOCKED ||
857857
have != BTREE_NODE_WRITE_LOCKED) &&
858858
want != have);
859+
860+
BUG_ON(btree_node_locked(path, l) &&
861+
path->l[l].lock_seq != six_lock_seq(&path->l[l].b->c.lock));
859862
}
860863
}
861864

0 commit comments

Comments
 (0)