Thread (16 messages) 16 messages, 1 author, 2021-12-15
STALE1671d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 09/15] btrfs-progs: repair: traverse tree blocks for extent tree v2

From: Josef Bacik <josef@toxicpanda.com>
Date: 2021-12-15 20:15:11
Subsystem: the rest · Maintainer: Linus Torvalds

If we have extent-tree-v2 enabled we can't only rely on the extent trees
to find all the used space, we have to walk all the trees as well.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 common/repair.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/common/repair.c b/common/repair.c
index 9071e627..6784534b 100644
--- a/common/repair.c
+++ b/common/repair.c
@@ -210,6 +210,12 @@ int btrfs_mark_used_blocks(struct btrfs_fs_info *fs_info,
 	struct rb_node *n;
 	int ret;
 
+	if (btrfs_fs_incompat(fs_info, EXTENT_TREE_V2)) {
+		ret = btrfs_mark_used_tree_blocks(fs_info, tree);
+		if (ret)
+			return ret;
+	}
+
 	root = btrfs_extent_root(fs_info, 0);
 	while (1) {
 		ret = populate_used_from_extent_root(root, tree);
-- 
2.26.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help