Commit fadc6067 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Set path->uptodate when no node at level

We were failing to set path->uptodate when reaching the end of a btree
node iterator, causing the new prefetch code for backpointers gc to go
into an infinite loop.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 94817db9
...@@ -1146,7 +1146,7 @@ int bch2_btree_path_traverse_one(struct btree_trans *trans, ...@@ -1146,7 +1146,7 @@ int bch2_btree_path_traverse_one(struct btree_trans *trans,
path = &trans->paths[path_idx]; path = &trans->paths[path_idx];
if (unlikely(path->level >= BTREE_MAX_DEPTH)) if (unlikely(path->level >= BTREE_MAX_DEPTH))
goto out; goto out_uptodate;
path->level = btree_path_up_until_good_node(trans, path, 0); path->level = btree_path_up_until_good_node(trans, path, 0);
...@@ -1179,7 +1179,7 @@ int bch2_btree_path_traverse_one(struct btree_trans *trans, ...@@ -1179,7 +1179,7 @@ int bch2_btree_path_traverse_one(struct btree_trans *trans,
goto out; goto out;
} }
} }
out_uptodate:
path->uptodate = BTREE_ITER_UPTODATE; path->uptodate = BTREE_ITER_UPTODATE;
out: out:
if (bch2_err_matches(ret, BCH_ERR_transaction_restart) != !!trans->restarted) if (bch2_err_matches(ret, BCH_ERR_transaction_restart) != !!trans->restarted)
......
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