mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-16 00:34:32 +08:00
btrfs-progs: mkfs: check for sane sectorsize earlier
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
976f6adfb5
commit
b318553f33
6
mkfs.c
6
mkfs.c
@ -1636,6 +1636,12 @@ int main(int argc, char **argv)
|
||||
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",
|
||||
|
Loading…
Reference in New Issue
Block a user