From: Tobias Stoeckmann Date: Wed, 22 Apr 2026 19:14:45 +0000 (+0200) Subject: mkfs.cramfs: Add -p padding only once X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=07114372f963fe4dc388bf4f6d3d7cf498d2c27f;p=thirdparty%2Futil-linux.git mkfs.cramfs: Add -p padding only once If -p is supplied multiple times, the estimated filesystem size is increased multiple times as well, even though padding will happen only once. Increase fslen_ub only once. Signed-off-by: Tobias Stoeckmann --- diff --git a/disk-utils/mkfs.cramfs.c b/disk-utils/mkfs.cramfs.c index 13c93e3a4..f99e8d995 100644 --- a/disk-utils/mkfs.cramfs.c +++ b/disk-utils/mkfs.cramfs.c @@ -779,7 +779,6 @@ int main(int argc, char **argv) break; case 'p': opt_pad = PAD_SIZE; - fslen_ub += PAD_SIZE; break; case 's': /* old option, ignored */ @@ -804,6 +803,8 @@ int main(int argc, char **argv) dirname = argv[optind]; outfile = argv[optind + 1]; + fslen_ub += opt_pad; + if (blksize == 0) blksize = getpagesize();