Commit 508b1f71 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Fix bch2_btree_iter_peek_prev()

In !BTREE_ITER_IS_EXTENTS mode, we shouldn't be looking at k->size, i.e.
we shouldn't use bkey_start_pos().
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent 31029f2f
......@@ -1779,7 +1779,7 @@ struct bkey_s_c bch2_btree_iter_peek_prev(struct btree_iter *iter)
if (!k.k ||
((iter->flags & BTREE_ITER_IS_EXTENTS)
? bkey_cmp(bkey_start_pos(k.k), iter->pos) >= 0
: bkey_cmp(bkey_start_pos(k.k), iter->pos) > 0))
: bkey_cmp(k.k->p, iter->pos) > 0))
k = btree_iter_level_prev(iter, l);
if (likely(k.k))
......
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