diff options
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -238,6 +238,9 @@ static inline int write_temp_super(int fd, struct btrfs_super_block *sb, * * For now sys chunk array will be empty and dev_item is empty too. * They will be re-initialized at temp chunk tree setup. + * + * The superblock signature is not valid, denotes a partially created + * filesystem, needs to be finalized. */ static int setup_temp_super(int fd, struct btrfs_mkfs_config *cfg, u64 root_bytenr, u64 chunk_bytenr) @@ -276,7 +279,7 @@ static int setup_temp_super(int fd, struct btrfs_mkfs_config *cfg, btrfs_set_super_bytenr(super, cfg->super_bytenr); btrfs_set_super_num_devices(super, 1); - btrfs_set_super_magic(super, BTRFS_MAGIC); + btrfs_set_super_magic(super, BTRFS_MAGIC_PARTIAL); btrfs_set_super_generation(super, 1); btrfs_set_super_root(super, root_bytenr); btrfs_set_super_chunk_root(super, chunk_bytenr); @@ -1004,6 +1007,9 @@ out: /* * @fs_uuid - if NULL, generates a UUID, returns back the new filesystem UUID + * + * The superblock signature is not valid, denotes a partially created + * filesystem, needs to be finalized. */ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg, struct btrfs_convert_context *cctx) @@ -1064,7 +1070,7 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg, btrfs_set_super_bytenr(&super, cfg->blocks[0]); btrfs_set_super_num_devices(&super, 1); - btrfs_set_super_magic(&super, BTRFS_MAGIC); + btrfs_set_super_magic(&super, BTRFS_MAGIC_PARTIAL); btrfs_set_super_generation(&super, 1); btrfs_set_super_root(&super, cfg->blocks[1]); btrfs_set_super_chunk_root(&super, cfg->blocks[3]); |