summaryrefslogtreecommitdiff
path: root/ext4_utils/make_ext4fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext4_utils/make_ext4fs.c')
-rw-r--r--ext4_utils/make_ext4fs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index b84db9b3..58069f31 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -753,17 +753,17 @@ int make_ext4fs_internal(int fd, const char *_directory, const char *_target_out
if (info.len <= 0)
info.len = get_file_size(fd);
- if (info.len <= 0) {
- fprintf(stderr, "Need size of filesystem\n");
- return EXIT_FAILURE;
- }
-
if (info.block_size <= 0)
info.block_size = compute_block_size();
/* Round down the filesystem length to be a multiple of the block size */
info.len &= ~((u64)info.block_size - 1);
+ if (info.len <= 0) {
+ fprintf(stderr, "filesystem size too small\n");
+ return EXIT_FAILURE;
+ }
+
if (info.journal_blocks == 0)
info.journal_blocks = compute_journal_blocks();