Commit c82ed304 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix bch2_btree_path_traverse_all()

We need to take a ref on a path while we're traversing it: this fixes a
bug with paths getting reused while being traversed, in the key cache
fill code.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ee94c413
......@@ -999,7 +999,10 @@ static int bch2_btree_path_traverse_all(struct btree_trans *trans)
* the same position:
*/
if (path->uptodate) {
__btree_path_get(path, false);
ret = btree_path_traverse_one(trans, path, 0, _THIS_IP_);
__btree_path_put(path, false);
if (bch2_err_matches(ret, BCH_ERR_transaction_restart) ||
ret == -ENOMEM)
goto retry_all;
......
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