bcachefs: Fix btree iter flags in data move (2)
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 17 Mar 2025 19:07:06 +0000 (15:07 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 26 Mar 2025 20:26:35 +0000 (16:26 -0400)
commit9314e2fb260570d64eef0141ad49526c6637e36f
tree75bd943a9c74c4c7d19d8933b60a07500da6e44b
parent19ff84b20d62e62ff527a384b35102bf745a70d1
bcachefs: Fix btree iter flags in data move (2)

Data move -> move_get_io_opts -> bch2_get_update_rebalance_opts

requires a not_extents iterator; this fixes the path where we're walking
the extents btree and chase a reflink pointer into the reflink btree.

bch2_lookup_indirect_extent() requires working with an extents iterator
(due to peek_slot() semantics), so we implement
bch2_lookup_indirect_extent_for_move().

This is simplified because there's no need to report
indirect_extent_missing_errors here, that can be deferred until fsck or
when a user reads that data.

Reported-by: Maƫl Kerbiriou <mael.kerbiriou@free.fr>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/move.c