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>
ostringstream oss;
oss << "crawl_" << subvol << "_" << inode;
const auto task_title = oss.str();
+ // this_state.m_objectid was advanced to inode+1 by peek_front()->fetch_extents().
+ // Fix: use the actual inode from this_range so BtrfsExtentDataFetcher finds
+ // the correct inode (exact-match search).
+ auto bfc_state = this_state;
+ bfc_state.m_objectid = inode;
const auto bfc = make_shared<BeesFileCrawl>((BeesFileCrawl) {
.m_ctx = m_ctx,
.m_crawl = this_crawl,
.m_roots = m_roots,
.m_hold = this_crawl->hold_state(this_state),
- .m_state = this_state,
+ .m_state = bfc_state,
.m_offset = this_range.begin(),
});
BEESNOTE("Starting task " << this_range);