]> git.hungrycats.org Git - bees/commitdiff
extent scan: log the bfr when removing a prealloc extent
authorZygo Blaxell <bees@furryterror.org>
Sun, 15 Jun 2025 07:19:33 +0000 (03:19 -0400)
committerZygo Blaxell <bees@furryterror.org>
Thu, 19 Jun 2025 02:33:05 +0000 (22:33 -0400)
With subvol scan, the crawl task name is the subvol/inode pair
corresponding to the file offset in the log message.  The identity of
the file can be determined by looking up the subvol/inode pair in the
log message.

With extent scan, the crawl task name is the extent bytenr corresponding
to the file offset in the log message.  This extent is deleted when the
log message is emitted, so a later lookup on the extent bytenr will not
find any references to the extent, and the identity of the file cannot
be determined.

Log the bfr, which does a /proc lookup on the name of the fd, so the
filename is logged.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees-context.cc

index ff3e3ca94464de87e06552b3bbd342f5545e11ae..0ffa3dad6ab85026be11d76c44e1596a3bd46225 100644 (file)
@@ -387,7 +387,7 @@ BeesContext::scan_one_extent(const BeesFileRange &bfr, const Extent &e)
        if (e.flags() & Extent::PREALLOC) {
                // Prealloc is all zero and we replace it with a hole.
                // No special handling is required here.  Nuke it and move on.
-               BEESLOGINFO("prealloc extent " << e);
+               BEESLOGINFO("prealloc extent " << e << " in " << bfr);
                // Must not extend past EOF
                auto extent_size = min(e.end(), bfr.file_size()) - e.begin();
                // Must hold tmpfile until dedupe is done