bcachefs: btree_path_make_mut() clears should_be_locked

This fixes a bug where __bch2_btree_node_update_key() wasn't clearing
should_be_locked, leading to bch2_btree_path_traverse() always failing -
all callers of btree_path_make_mut() want should_be_locked cleared, so
do it there.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-03-30 13:47:07 -04:00 committed by Kent Overstreet
parent 7071878bab
commit d864842581
2 changed files with 4 additions and 4 deletions

View File

@ -1662,9 +1662,8 @@ static struct btree_path *btree_path_clone(struct btree_trans *trans, struct btr
return new;
}
struct btree_path * __must_check
__bch2_btree_path_make_mut(struct btree_trans *trans,
struct btree_path *path, bool intent)
struct btree_path *__bch2_btree_path_make_mut(struct btree_trans *trans,
struct btree_path *path, bool intent)
{
__btree_path_put(path, intent);
path = btree_path_clone(trans, path, intent);
@ -1672,6 +1671,7 @@ __bch2_btree_path_make_mut(struct btree_trans *trans,
#ifdef CONFIG_BCACHEFS_DEBUG
path->ip_allocated = _RET_IP_;
#endif
path->should_be_locked = false;
return path;
}
@ -1688,7 +1688,6 @@ __bch2_btree_path_set_pos(struct btree_trans *trans,
path = bch2_btree_path_make_mut(trans, path, intent);
path->pos = new_pos;
path->should_be_locked = false;
trans->paths_sorted = false;
if (unlikely(path->cached)) {

View File

@ -149,6 +149,7 @@ bch2_btree_path_make_mut(struct btree_trans *trans,
{
if (path->ref > 1 || path->preserve)
path = __bch2_btree_path_make_mut(trans, path, intent);
path->should_be_locked = false;
return path;
}