Signed-off-by: David Sterba <dsterba@suse.com>
features))
exit(1);
+ if (sectorsize < sizeof(struct btrfs_super_block)) {
+ error("sectorsize smaller than superblock: %u < %zu",
+ sectorsize, sizeof(struct btrfs_super_block));
+ exit(1);
+ }
+
/* Check device/block_count after the nodesize is determined */
if (block_count && block_count < btrfs_min_dev_size(nodesize)) {
error("size %llu is too small to make a usable filesystem",
}
/* and write out the super block */
- BUG_ON(sizeof(super) > cfg->sectorsize);
memset(buf->data, 0, BTRFS_SUPER_INFO_SIZE);
memcpy(buf->data, &super, sizeof(super));
buf->len = BTRFS_SUPER_INFO_SIZE;