]> git.hungrycats.org Git - bees/commit
bees-roots: fix off-by-one objectid in subvol scanner crawl_one_inode
authorZygo Blaxell <bees@furryterror.org>
Sun, 15 Mar 2026 03:21:54 +0000 (23:21 -0400)
committerZygo Blaxell <bees@furryterror.org>
Sat, 2 May 2026 03:48:58 +0000 (23:48 -0400)
commite08a0349d00b0699674186d5a2bd8183beb8905f
treee6e5e8339c1e50650925278e6ddd298aef0a8c6b
parent719046b53b4942e6c6e7ccfcb1a3f1b4bd565f1c
bees-roots: fix off-by-one objectid in subvol scanner crawl_one_inode

peek_front() -> fetch_extents() advances m_state.m_objectid to
found_inode + scale_size before crawl_one_inode() calls get_state_end().
The resulting this_state.m_objectid is one past the actual inode, but
BeesFileCrawl uses it with BtrfsExtentDataFetcher which requires an
exact objectid match.  The net effect: every inode is scanned with the
objectid of the *next* inode, finding nothing.

Fix: derive bfc_state from this_state but override m_objectid with the
actual inode extracted from this_range.fid().ino().  The crawl's own
set_state() call at the end of crawl_one_inode() still uses this_state
(objectid = found_inode + 1), correctly positioning the next search.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
src/bees-roots.cc