bcachefs: Fix bch2_btree_node_iter_prev_filter()
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 19 Aug 2019 17:43:01 +0000 (13:43 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:25 +0000 (17:08 -0400)
commite67ab0450cca7dc1673e4cd00eecf9d896b15889
tree8d50317ed64879a1b9b692c25d66685eaad1c930
parent9df279407a2daaf8e6586be483632fe9aaca6ef3
bcachefs: Fix bch2_btree_node_iter_prev_filter()

bch2_btree_node_iter_prev_filter() tried to be smart about iterating
backwards when skipping over whiteouts/discards - but unfortunately,
doing so can leave the node iterator in an inconsistent state; the sane
solution is to just always iterate backwards one key at a time.

But we compact btree nodes when more than a quarter of the keys are
whiteouts/discards, so the optimization wasn't buying us that much
anyways.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bset.c
fs/bcachefs/bset.h