From: Marcus Huewe Date: Thu, 12 May 2016 19:25:14 +0000 (-0400) Subject: mke2fs: fix filesystem size calculation, if an offset is specified X-Git-Tag: v1.43~10 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=dc01088db5f720f88db66a383bd066d3d5620fbe;p=tools%2Fe2fsprogs.git mke2fs: fix filesystem size calculation, if an offset is specified If a filesystem size is explicitly specified, it should be used without subtracting the offset. Signed-off-by: Marcus Huewe Signed-off-by: Theodore Ts'o --- diff --git a/misc/mke2fs.c b/misc/mke2fs.c index dd5bb35..e0a98e7 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -1874,6 +1874,8 @@ profile_error: flags |= VERBOSE_CREATE; if (fs_blocks_count == 0) flags |= NO_SIZE; + else + explicit_fssize = 1; if (!check_plausibility(device_name, flags, &is_device) && !force) proceed_question(proceed_delay); @@ -1881,7 +1883,6 @@ profile_error: /* Determine the size of the device (if possible) */ if (noaction && fs_blocks_count) { - explicit_fssize = 1; dev_size = fs_blocks_count; retval = 0; } else