]> git.hungrycats.org Git - bees/commitdiff
extent scan: pick the right block groups for mixed-bg filesystems
authorZygo Blaxell <bees@furryterror.org>
Thu, 19 Dec 2024 04:32:09 +0000 (23:32 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sat, 4 Jan 2025 04:15:37 +0000 (23:15 -0500)
The progress indicator was failing on a mixed-bg filesystem because those
filesystems have block groups which have both _DATA and _METADATA bits,
and the filesystem size calculation was excluding block groups that have
_METADATA set.  It should exclude block groups that have _DATA not set.

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

index 2cd70b82f215fa540ec3deff886591348b3ce579..02faa7febe242292758256ae231455c2bf79f02e 100644 (file)
@@ -970,7 +970,9 @@ BeesScanModeExtent::next_transid(const CrawlMap &crawl_map_unused)
                        .first_bytenr = offset,
                        .first_total = fs_size,
                };
-               if (bti.chunk_type() & (BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_SYSTEM)) {
+               // Mixed-bg filesystems have block groups that are data _and_ metadata.
+               // Block groups that are _only_ metadata should be filtered out.
+               if (0 == (bti.chunk_type() & BTRFS_BLOCK_GROUP_DATA)) {
                        continue;
                }
                fs_size += chunk_length;