Commit 6caf0578 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix bch2_btree_iter_advance()

Was popping an assertion on !BTREE_ITER_ALL_SNAPSHOTS iters when getting
to the end.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 41f9b7d3
......@@ -2021,7 +2021,9 @@ struct btree *bch2_btree_iter_next_node(struct btree_iter *iter)
inline bool bch2_btree_iter_advance(struct btree_iter *iter)
{
struct bpos pos = iter->k.p;
bool ret = bpos_cmp(pos, SPOS_MAX) != 0;
bool ret = (iter->flags & BTREE_ITER_ALL_SNAPSHOTS
? bpos_cmp(pos, SPOS_MAX)
: bkey_cmp(pos, SPOS_MAX)) != 0;
if (ret && !(iter->flags & BTREE_ITER_IS_EXTENTS))
pos = bkey_successor(iter, pos);
......
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