bcachefs: Fix a deadlock

btree_node_lock_increment() was incorrectly skipping over the current
iter when checking if we should increment a node we already have locked.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2020-04-24 18:25:11 -04:00 committed by Kent Overstreet
parent 2c480a7102
commit bbe65614b7

View file

@ -164,8 +164,7 @@ static inline bool btree_node_lock_increment(struct btree_iter *iter,
struct btree_iter *linked;
trans_for_each_iter(iter->trans, linked)
if (linked != iter &&
linked->l[level].b == b &&
if (linked->l[level].b == b &&
btree_node_locked_type(linked, level) >= want) {
six_lock_increment(&b->c.lock, want);
return true;