Device tree is one of the least important tree, it only contains:
- Device status
Like various error count
- Device extents
Only makes sense for chunk allocation and physical->logical map, and
even for that only purpose, we can rebuild it easily from chunk tree.
So device tree even makes less sense compared to extent tree, while we
still can't skip it at btrfs-progs.
This makes restore less useful. So this patch will make device tree to
follow the same requirement for OPEN_CTREE_PARTIAL.
Reported-by: Christian Wimmer <telefonchris@xxxxxxxxxx>
Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
---
disk-io.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/disk-io.c b/disk-io.c
index 659f8b93..22aa2a61 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -947,12 +947,10 @@ int btrfs_setup_all_roots(struct btrfs_fs_info *fs_info, u64 root_tree_bytenr,
return ret;
fs_info->extent_root->track_dirty = 1;
- ret = find_and_setup_root(root, fs_info, BTRFS_DEV_TREE_OBJECTID,
- fs_info->dev_root);
- if (ret) {
- printk("Couldn't setup device tree\n");
- return -EIO;
- }
+ ret = setup_root_or_create_block(fs_info, flags, fs_info->dev_root,
+ BTRFS_DEV_TREE_OBJECTID, "device");
+ if (ret)
+ return ret;
fs_info->dev_root->track_dirty = 1;
ret = setup_root_or_create_block(fs_info, flags, fs_info->csum_root,
--
2.24.0