Commit 0f35e086 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix return code from btree_path_traverse_one()

trans->restarted is a positive error code, not the usual negative
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 6b1b186a
......@@ -1079,7 +1079,7 @@ static int btree_path_traverse_one(struct btree_trans *trans,
unsigned long trace_ip)
{
unsigned depth_want = path->level;
int ret = trans->restarted;
int ret = -((int) trans->restarted);
if (unlikely(ret))
goto out;
......
......@@ -359,6 +359,11 @@ __btree_iter_peek_node_and_restart(struct btree_trans *trans, struct btree_iter
return b;
}
/*
* XXX
* this does not handle transaction restarts from bch2_btree_iter_next_node()
* correctly
*/
#define __for_each_btree_node(_trans, _iter, _btree_id, _start, \
_locks_want, _depth, _flags, _b, _ret) \
for (bch2_trans_node_iter_init((_trans), &(_iter), (_btree_id), \
......
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