summaryrefslogtreecommitdiff
path: root/disk-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'disk-io.c')
-rw-r--r--disk-io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/disk-io.c b/disk-io.c
index 6896bd78..3080e62a 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -577,6 +577,10 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr)
BUG_ON(!chunk_root->node);
+ read_extent_buffer(chunk_root->node, fs_info->chunk_tree_uuid,
+ (unsigned long)btrfs_header_chunk_tree_uuid(chunk_root->node),
+ BTRFS_UUID_SIZE);
+
ret = btrfs_read_chunk_tree(chunk_root);
BUG_ON(ret);
@@ -634,7 +638,7 @@ int write_all_supers(struct btrfs_root *root)
btrfs_set_device_sector_size(sb, dev_item, dev->sector_size);
write_extent_buffer(sb, dev->uuid,
(unsigned long)btrfs_device_uuid(dev_item),
- BTRFS_DEV_UUID_SIZE);
+ BTRFS_UUID_SIZE);
sb->fd = dev->fd;
sb->dev_bytenr = BTRFS_SUPER_INFO_OFFSET;
btrfs_set_header_flag(sb, BTRFS_HEADER_FLAG_WRITTEN);