Skip to contentSkip to conversation

Bug#1138789: FTBFS on loong64: mkswap: error: swap area needs to be at least 160 KiB

PATCH In review Chris Hofstaedtler 2 participants 4 messages Jun 3 – Jun 8 1 message not in the archive Util-Linux package

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Johannes, Karel,

util-linux 2.42.1 apparently fails its mkswap tests on loong64. Given it fails in mkswap/mkswap-file-existing, I suspect this is "caused" by commit 775729884a3945a53df33e0d3ff2ba263b96b59e / 6d87ff51568c017a6d08043d554bf0ea8dee5457.

Could you take a look please?

Quoted 9 lines

diff-{{{

build/reproducible-path/util-linux-2.42.1/tests/output/mkswap/mkswap-file-existing new file +3 -0
@@ -0,0 +1,3 @@
+mkswap failed
+mkswap: error: swap area needs to be at least 160 KiB
+mkswap -F failed on existing file

}}}-diff

Quoted 7 lines

FAILED (mkswap/mkswap-file-existing)
========= script: /build/reproducible-path/util-linux-2.42.1/tests/ts/mkswap/mkswap ================= ================= OUTPUT =====================
1 mkswap failed
2 mkswap: error: swap area needs to be at least 160 KiB
3 mkswap -F failed on existing file

Full build log at:

https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=loong64&ver=2.42.1-1&stamp=1780514831&file=log

Many thanks!
Chris

#2 lore raw

PATCH 1/1 mkswap: use 64k pages in file-existing test

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.

Fixes 775729884a3945a53df33e0d3ff2ba263b96b59e
---
 tests/ts/mkswap/mkswap | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/ts/mkswap/mkswap +2 -2
index 19111971c..fa7e6b462 100755
@@ -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"
 
Signature · 1 line
2.53.0
maintainer
#3 lore raw

Re: [PATCH] mkswap: use 64k pages in file-existing test

Quoted 6 lines · Chris Hofstaedtler

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

Quoted 7 lines

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.

It was already fixed by commit c5da6dcfe, which explicitly forces the page size to 4096 rather than extending the file size.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#4 lore raw

Re: Bug#1138789: [PATCH] mkswap: use 64k pages in file-existing test

Quoted 10 lines · Karel Zak
Quoted 9 lines · Chris Hofstaedtler

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.

Quoted 7 lines
Quoted 4 lines

Noticed on Debian loong64 kernel 7.0.9+deb14-loong64, and on sparc64 and alpha.

It was already fixed by commit c5da6dcfe, which explicitly forces the page size to 4096 rather than extending the file size.

Ah, thank you! I've pulled this commit into our build.

Best,
Chris