[PATCH] mkswap: use 64k pages in file-existing test
Chris Hofstaedtler <[email protected]> Thu, 4 Jun 2026 14:20:56 +0200
| Newsgroups | org.kernel.vger.util-linux |
|---|---|
| Message-ID | <[email protected]> |
Some systems run with kernels using page sizes other than 4K. The file-existing test used a file of 10 pages at 4K. This would fail on kernels with higher page sizes (here 16K) like this: mkswap: error: swap area needs to be at least 160 KiB Use 10 * 64K pages, hopefully allowing all kernels with 4K, 16K, 64K pages to pass the tests. Noticed on Debian loong64 kernel 7.0.9+deb14-loong64, and on sparc64 and alpha. Bug: https://bugs.debian.org/1138789 Fixes: 775729884a3945a53df33e0d3ff2ba263b96b59e Signed-off-by: Chris Hofstaedtler <[email protected]> --- tests/ts/mkswap/mkswap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ts/mkswap/mkswap b/tests/ts/mkswap/mkswap index 19111971c..fa7e6b462 100755 --- a/tests/ts/mkswap/mkswap +++ b/tests/ts/mkswap/mkswap @@ -105,11 +105,11 @@ ts_init_subtest file-existing outimg="$TS_OUTDIR/existing.img" rm -f "$outimg" -"$TS_CMD_MKSWAP" -q -U "$UUID" -F -s $((4096 * 10)) "$outimg" \ +"$TS_CMD_MKSWAP" -q -U "$UUID" -F -s $((65536 * 10)) "$outimg" \ >> "$TS_OUTPUT" 2>/dev/null \ || ts_log "mkswap failed" -"$TS_CMD_MKSWAP" -q -U "$UUID" -F -s $((4096 * 10)) "$outimg" \ +"$TS_CMD_MKSWAP" -q -U "$UUID" -F -s $((65536 * 10)) "$outimg" \ >> "$TS_OUTPUT" 2>&1 \ || ts_log "mkswap -F failed on existing file" -- 2.53.0