summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Sumrall <ksumrall@android.com>2011-07-13 17:34:22 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-13 17:34:22 -0700
commit66de9c9e5190902a1ee6d9f58c347e5f056b2198 (patch)
tree0b37d94e376d8afc17371fdcf78c6229e3458889
parent3604d4b7672cde67a88e064393d013fefe484156 (diff)
parent88833a6277f305b6a03ff29d8e9ffe717ddb4045 (diff)
downloadextras-66de9c9e5190902a1ee6d9f58c347e5f056b2198.tar.gz
Merge "Round down the filesystem size to a multiple of the block size"
-rw-r--r--ext4_utils/make_ext4fs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 298a02af..dbffc8d1 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -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();