Message ID | 1348645928-3432-2-git-send-email-robin.k.dong@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/mkfs.c b/mkfs.c index bb01f64..23bde2d 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1330,7 +1330,11 @@ int main(int ac, char **av) &dev_block_count, &mixed, nodiscard); if (block_count == 0) block_count = dev_block_count; - else if (block_count > dev_block_count) { + else if (block_count < 3 * BTRFS_MKFS_SYSTEM_GROUP_SIZE) { + fprintf(stderr, "Illegal total number of bytes %u\n", + block_count); + exit(1); + } else if (block_count > dev_block_count) { fprintf(stderr, "%s is smaller than requested size\n", file); exit(1); }