Commit 14989d54 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix bch2_btree_iter_next() after peek_slot()

this deserves a unit test
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 495fa1a2
......@@ -1440,6 +1440,14 @@ struct bkey_s_c bch2_btree_iter_next(struct btree_iter *iter)
return bch2_btree_iter_peek(iter);
}
if (unlikely(bkey_deleted(&iter->k))) {
/*
* we're currently pointed at a hole, because previously we were
* iterating over slots:
*/
return bch2_btree_iter_peek(iter);
}
do {
bch2_btree_node_iter_advance(&l->iter, l->b);
p = bch2_btree_node_iter_peek_all(&l->iter, l->b);
......
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