All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix test/misc/swaplabel failure due to change in mkswap behaviour.
@ 2021-10-18 17:53 Chris Hofstaedtler
  2021-10-19  9:39 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Hofstaedtler @ 2021-10-18 17:53 UTC (permalink / raw)
  To: util-linux; +Cc: Mark Hindley

From: Mark Hindley <mark@hindley.org.uk>

mkswap now warns if the image file has holes. If fallocate is used to create the
file, use POSIX semantics to ensure the file has no holes.

This fixes the test failure

misc: swaplabel                      ... FAILED (misc/swaplabel)
========= script: /build/util-linux-2.37.2/tests/ts/misc/swaplabel =================
================= OUTPUT =====================
     1  Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
     2  LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
     3  LABEL: 1234567890abcde
     4  UUID:  12345678-abcd-abcd-abcd-1234567890ab
================= EXPECTED ===================
     1  Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
     2  LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
     3  LABEL: 1234567890abcde
     4  UUID:  12345678-abcd-abcd-abcd-1234567890ab
================= O/E diff ===================
==============================================

The additional error appears in swaplabel.err:

 mkswap: <swapfile> contains holes or other unsupported extents.
         This swap file can be rejected by kernel on swap activation!
         Use --verbose for more details.

[zeha@debian.org: this appears to be important/required when building
inside cowbuilder, on an ext3 filesystem.]

Signed-off-by: Mark Hindley <mark@hindley.org.uk>
---
 tests/ts/misc/swaplabel | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ts/misc/swaplabel b/tests/ts/misc/swaplabel
index 0801cb213..8b1abb5c3 100755
--- a/tests/ts/misc/swaplabel
+++ b/tests/ts/misc/swaplabel
@@ -25,7 +25,7 @@ ts_check_test_command "$TS_HELPER_SYSINFO"
 # fallocate does not work on most file systems
 function fallocate_or_skip()
 {
-	$TS_CMD_FALLOCATE -l $1 $2 2>/dev/null || \
+	$TS_CMD_FALLOCATE -x -l $1 $2 2>/dev/null || \
 	truncate -s $1 $2 || \
 	ts_skip "no way to create test image"
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix test/misc/swaplabel failure due to change in mkswap behaviour.
  2021-10-18 17:53 [PATCH] Fix test/misc/swaplabel failure due to change in mkswap behaviour Chris Hofstaedtler
@ 2021-10-19  9:39 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2021-10-19  9:39 UTC (permalink / raw)
  To: Chris Hofstaedtler; +Cc: util-linux, Mark Hindley

On Mon, Oct 18, 2021 at 05:53:01PM +0000, Chris Hofstaedtler wrote:
>  tests/ts/misc/swaplabel | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-19  9:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 17:53 [PATCH] Fix test/misc/swaplabel failure due to change in mkswap behaviour Chris Hofstaedtler
2021-10-19  9:39 ` Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.