bcachefs: Use for_each_btree_key_upto() more consistently
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 11 Oct 2022 08:32:41 +0000 (04:32 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:50 +0000 (17:09 -0400)
commitc72f687a1ff1801b404fab804fdddcaf034e6ef4
tree53648acc4521cf44688250b6402edf871bec0781
parent5b3008bc6182e56fdd5ba36fdf324430d0792e0c
bcachefs: Use for_each_btree_key_upto() more consistently

It's important that in BTREE_ITER_FILTER_SNAPSHOTS mode we always use
peek_upto() and provide an end for the interval we're searching for -
otherwise, when we hit the end of the inode the next inode be in a
different subvolume and not have any keys in the current snapshot, and
we'd iterate over arbitrarily many keys before returning one.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/ec.c
fs/bcachefs/extent_update.c
fs/bcachefs/fs-io.c
fs/bcachefs/fsck.c
fs/bcachefs/io.c
fs/bcachefs/quota.c
fs/bcachefs/reflink.c
fs/bcachefs/tests.c