From: Chris Hofstaedtler <zeha@debian.org>
To: util-linux@vger.kernel.org
Cc: Mark Hindley <mark@hindley.org.uk>
Subject: [PATCH] Fix test/misc/swaplabel failure due to change in mkswap behaviour.
Date: Mon, 18 Oct 2021 17:53:01 +0000 [thread overview]
Message-ID: <20211018175301.23636-1-zeha@debian.org> (raw)
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
next reply other threads:[~2021-10-18 17:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 17:53 Chris Hofstaedtler [this message]
2021-10-19 9:39 ` [PATCH] Fix test/misc/swaplabel failure due to change in mkswap behaviour Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211018175301.23636-1-zeha@debian.org \
--to=zeha@debian.org \
--cc=mark@hindley.org.uk \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox