bcachefs: Make btree_iter_peek_prev() assert more precise
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 22 Apr 2025 08:45:25 +0000 (04:45 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 24 Apr 2025 23:09:52 +0000 (19:09 -0400)
commitc4f89a1d3590243ef1bbd55557a1f55a4a93927d
tree054713fa34d15009f740fbec1887d22295b2dac2
parent394ef278e1fdadc1f27acd8c0549a8831dfc1833
bcachefs: Make btree_iter_peek_prev() assert more precise

The issue this assert is guarding against is that in
BTREE_ITER_filter_snapshots mode we only want to be iterating within a
single inode number - if we iterate into another inode number with keys
for a different snapshot tree, we'll loop arbitrarily long before
finding a key we can return.

This comes up in the unit tests, where we're using inode 0 for our test
keys.

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