* [LTP] [PATCH] swapon03: Correct the test swapfile name for swapoff() to work
@ 2025-10-31 0:44 Avinesh Kumar
2025-10-31 8:13 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Avinesh Kumar @ 2025-10-31 0:44 UTC (permalink / raw)
To: ltp
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] swapon03: Correct the test swapfile name for swapoff() to work
2025-10-31 0:44 [LTP] [PATCH] swapon03: Correct the test swapfile name for swapoff() to work Avinesh Kumar
@ 2025-10-31 8:13 ` Petr Vorel
2025-10-31 8:44 ` Li Wang via ltp
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2025-10-31 8:13 UTC (permalink / raw)
To: Avinesh Kumar; +Cc: ltp
Hi Avinesh,
> 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.
Good catch, thank you!
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] swapon03: Correct the test swapfile name for swapoff() to work
2025-10-31 8:13 ` Petr Vorel
@ 2025-10-31 8:44 ` Li Wang via ltp
0 siblings, 0 replies; 3+ messages in thread
From: Li Wang via ltp @ 2025-10-31 8:44 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
On Fri, Oct 31, 2025 at 4:14 PM Petr Vorel <pvorel@suse.cz> wrote:
> Hi Avinesh,
>
> > 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.
>
> Good catch, thank you!
>
Absolutely, patch merged.
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-31 8:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 0:44 [LTP] [PATCH] swapon03: Correct the test swapfile name for swapoff() to work Avinesh Kumar
2025-10-31 8:13 ` Petr Vorel
2025-10-31 8:44 ` Li Wang via ltp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox