From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH V3 4/5] libswap: add function to prealloc contiguous file
Date: Tue, 23 Jan 2024 13:11:56 +0100 [thread overview]
Message-ID: <20240123121156.GA175806@pevik> (raw)
In-Reply-To: <20240123114840.2610533-5-liwang@redhat.com>
Hi Li,
swapoff01 fails on TMPDIR on btrfs (regardless kernel version):
# ./swapoff01
rm -f -f -r swapoff01 swapoff02 *.o *.pyc .cache.mk *.dwo .*.dwo
BUILD libltpswap.a
make[1]: Nothing to be done for 'all'.
CC testcases/kernel/syscalls/swapoff/swapoff01
CC testcases/kernel/syscalls/swapoff/swapoff02
tst_test.c:1709: TINFO: LTP version: 20230929-295-gc20ab499a
tst_test.c:1595: TINFO: Timeout per run is 0h 00m 30s
tst_ioctl.c:21: TINFO: FIBMAP ioctl is NOT supported: EINVAL (22)
libswap.c:33: TINFO: FS_NOCOW_FL attribute set on ./tstswap
swapoff01.c:24: TFAIL: Failed to turn on the swap file, skipping test iteration: EINVAL (22)
=> I guess we would need to replace tst_fill_file() with
prealloc_contiguous_file() (which is not public), or use make_swapfile()
directly. But here we create file first with 65536 blocks and make_swapfile()
creates 10 block file (with prealloc_contiguous_file() or previously also with
tst_fill_file()).
Kind regards,
Petr
--- testcases/kernel/syscalls/swapoff/swapoff01.c
+++ testcases/kernel/syscalls/swapoff/swapoff01.c
@@ -44,11 +44,8 @@ static void setup(void)
tst_brk(TBROK,
"Insufficient disk space to create swap file");
- if (tst_fill_file("swapfile01", 0x00, 1024, 65536))
+ if (make_swapfile("swapfile01", 1))
tst_brk(TBROK, "Failed to create file for swap");
-
- if (system("mkswap swapfile01 > tmpfile 2>&1") != 0)
- tst_brk(TBROK, "Failed to make swapfile");
}
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-01-23 12:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 11:48 [LTP] [V3 0/5] improvement work on libswap library Li Wang
2024-01-23 11:48 ` [LTP] [PATCH V3 1/5] libswap: add known swap supported fs check Li Wang
2024-01-23 11:48 ` [LTP] [PATCH V3 2/5] swapon01: Test on all filesystems Li Wang
2024-01-23 11:48 ` [LTP] [PATCH V3 3/5] swapon01: Improving test with memory limits and swap reporting Li Wang
2024-01-23 11:48 ` [LTP] [PATCH V3 4/5] libswap: add function to prealloc contiguous file Li Wang
2024-01-23 12:11 ` Petr Vorel [this message]
2024-01-23 12:37 ` Petr Vorel
2024-01-23 12:54 ` Li Wang
2024-01-23 15:47 ` Petr Vorel
2024-01-24 4:08 ` Li Wang
2024-01-24 10:06 ` Petr Vorel
2024-01-23 17:40 ` Petr Vorel
2024-01-24 4:27 ` Li Wang
2024-01-23 11:48 ` [LTP] [PATCH V3 5/5] libswap: Introduce file contiguity check Li Wang
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=20240123121156.GA175806@pevik \
--to=pvorel@suse.cz \
--cc=liwang@redhat.com \
--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 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.