For extent tree v2 we do not have metadata tracked in the extent root,
so every block we find we must account for as used in the appropriate
block group.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
check/main.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/check/main.c b/check/main.c
index da5aab89..cee7e7a0 100644
--- a/check/main.c
+++ b/check/main.c
@@ -6412,6 +6412,14 @@ static int run_next_block(struct btrfs_root *root,
if (ret)
goto out;
+ /*
+ * Extent tree v2 doesn't track metadata in the extent tree, mark any
+ * blocks we find as used for the block group.
+ */
+ if (btrfs_fs_incompat(gfs_info, EXTENT_TREE_V2))
+ update_block_group_used(block_group_cache, buf->start,
+ gfs_info->nodesize);
+
if (btrfs_is_leaf(buf)) {
btree_space_waste += btrfs_leaf_free_space(buf);
for (i = 0; i < nritems; i++) {--
2.26.3