From: Avinesh Kumar <akumar@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] swapon03: Correct the test swapfile name for swapoff() to work
Date: Fri, 31 Oct 2025 01:44:44 +0100 [thread overview]
Message-ID: <20251031004445.25185-1-akumar@suse.de> (raw)
Fix an obvious mistake in the test. It remained hidden as test used
to run successfully and was never executing it.
On failure, it causes umount to fail as we do not swapoff() for the
edge case swapfile, and also causes breakage in subsequent filesystems
as we use the same loop device.
swapon03.c:63: TINFO: Successfully created 22 swap files
swapon03.c:64: TINFO: create a swapfile size of 1 megabytes (MB)
swapon03.c:105: TFAIL: swapon(mntpoint/testswap, 0) succeeded
tst_device.c:417: TINFO: umount('mntpoint') failed with EBUSY, try 1...
tst_device.c:421: TINFO: Likely gvfsd-trash is probing newly mounted fs, kill it to speed up tests.
tst_device.c:417: TINFO: umount('mntpoint') failed with EBUSY, try 2...
tst_device.c:417: TINFO: umount('mntpoint') failed with EBUSY, try 3...
...
...
tst_device.c:417: TINFO: umount('mntpoint') failed with EBUSY, try 49...
tst_device.c:417: TINFO: umount('mntpoint') failed with EBUSY, try 50...
tst_device.c:428: TWARN: Failed to umount('mntpoint') after 50 retries
tst_test.c:1956: TINFO: === Testing on ext3 ===
tst_test.c:1280: TINFO: Formatting /dev/loop0 with ext3 opts='' extra opts=''
mke2fs 1.47.0 (5-Feb-2023)
/dev/loop0 is mounted; will not make a filesystem here!
tst_test.c:1280: TWARN: mkfs may have failed because the device is busy (e.g., udisks2 probing). Consider disabling background probing services.
tst_test.c:1280: TBROK: mkfs.ext3 failed with exit code 1
Summary:
passed 0
failed 1
broken 1
skipped 0
warnings 2
tst_device.c:270: TWARN: ioctl(/dev/loop0, LOOP_CLR_FD, 0) no ENXIO for too long
tst_tmpdir.c:347: TWARN: tst_rmdir: rmobj(/var/tmp/LTP_swa5hk5Lk) failed: unlink(/var/tmp/LTP_swa5hk5Lk/mntpoint) failed; errno=21: EISDIR
Fixes: 8fd941649a ("syscalls/swapon03: Simply this case")
Signed-off-by: Avinesh Kumar <akumar@suse.de>
---
testcases/kernel/syscalls/swapon/swapon03.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/swapon/swapon03.c b/testcases/kernel/syscalls/swapon/swapon03.c
index 0068560fe..d6445d5fc 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -97,7 +97,7 @@ static void clean_swap(void)
check_and_swapoff(filename);
}
- check_and_swapoff("testfile");
+ check_and_swapoff(TEST_FILE);
}
static void verify_swapon(void)
--
2.51.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2025-10-31 0:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 0:44 Avinesh Kumar [this message]
2025-10-31 8:13 ` [LTP] [PATCH] swapon03: Correct the test swapfile name for swapoff() to work Petr Vorel
2025-10-31 8:44 ` Li Wang via ltp
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=20251031004445.25185-1-akumar@suse.de \
--to=akumar@suse.de \
--cc=ltp@lists.linux.it \
/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