Commit 85eb2bae authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix trans_lock_write()

On failure to get a write lock (because we had a conflicting read lock),
we need to make sure to upgrade the read lock to an intent lock - or we
could end up spinning.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent f527afea
......@@ -569,7 +569,8 @@ static inline bool have_conflicting_read_lock(struct btree_trans *trans, struct
//if (path == pos)
// break;
if (path->nodes_locked != path->nodes_intent_locked)
if (path->nodes_locked != path->nodes_intent_locked &&
!bch2_btree_path_upgrade(trans, path, path->level + 1))
return true;
}
......
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