Commit 7071878b authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

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: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 81cdc8f3
......@@ -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;
......
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