From 6c36f4973fb7de35ca72f04afdaaa3955b507486 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 15 Jun 2025 03:19:33 -0400 Subject: [PATCH] extent scan: log the bfr when removing a prealloc extent 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 --- src/bees-context.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bees-context.cc b/src/bees-context.cc index ff3e3ca..0ffa3da 100644 --- a/src/bees-context.cc +++ b/src/bees-context.cc @@ -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