OSDN Git Service

Round down the filesystem size to a multiple of the block size
[android-x86/system-extras.git] / ext4_utils / make_ext4fs.c
index 298a02a..dbffc8d 100644 (file)
@@ -278,6 +278,9 @@ int make_ext4fs_internal(const char *filename, const char *directory,
        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.journal_blocks == 0)
                info.journal_blocks = compute_journal_blocks();