mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 06:43:09 +00:00
bcachefs: Add a missing btree_path_set_dirty() calls
bch2_btree_iter_next_node() was mucking with other btree_path state without setting path->update to be consistent with the fact that the path is very much no longer uptodate - oops. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
81cdc8f307
commit
7071878bab
@ -1701,6 +1701,7 @@ __bch2_btree_path_set_pos(struct btree_trans *trans,
|
||||
l = btree_path_up_until_good_node(trans, path, cmp);
|
||||
|
||||
if (btree_path_node(path, l)) {
|
||||
BUG_ON(!btree_node_locked(path, l));
|
||||
/*
|
||||
* We might have to skip over many keys, or just a few: try
|
||||
* advancing the node iterator, and if we have to skip over too
|
||||
@ -1906,6 +1907,8 @@ struct btree_path *bch2_path_get(struct btree_trans *trans,
|
||||
int i;
|
||||
|
||||
BUG_ON(trans->restarted);
|
||||
bch2_trans_verify_locks(trans);
|
||||
|
||||
btree_trans_sort_paths(trans);
|
||||
|
||||
btree_trans_sort_paths(trans);
|
||||
@ -2098,6 +2101,7 @@ struct btree *bch2_btree_iter_next_node(struct btree_iter *iter)
|
||||
btree_node_unlock(path, path->level);
|
||||
path->l[path->level].b = BTREE_ITER_NO_NODE_UP;
|
||||
path->level++;
|
||||
btree_path_set_dirty(path, BTREE_ITER_NEED_TRAVERSE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -2105,6 +2109,7 @@ struct btree *bch2_btree_iter_next_node(struct btree_iter *iter)
|
||||
__bch2_btree_path_unlock(path);
|
||||
path->l[path->level].b = BTREE_ITER_NO_NODE_GET_LOCKS;
|
||||
path->l[path->level + 1].b = BTREE_ITER_NO_NODE_GET_LOCKS;
|
||||
btree_path_set_dirty(path, BTREE_ITER_NEED_TRAVERSE);
|
||||
trace_trans_restart_relock_next_node(trans->fn, _THIS_IP_,
|
||||
path->btree_id, &path->pos);
|
||||
btree_trans_restart(trans);
|
||||
|
@ -1938,6 +1938,7 @@ static int __bch2_btree_node_update_key(struct btree_trans *trans,
|
||||
btree_node_unlock(iter2.path, iter2.path->level);
|
||||
path_l(iter2.path)->b = BTREE_ITER_NO_NODE_UP;
|
||||
iter2.path->level++;
|
||||
btree_path_set_dirty(iter2.path, BTREE_ITER_NEED_TRAVERSE);
|
||||
|
||||
trans->paths_sorted = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user