* [LTP] [PATCH 1/1] statx09: Format filesystem with page size
@ 2023-07-17 12:54 Petr Vorel
2023-07-18 14:33 ` Martin Doucha
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2023-07-17 12:54 UTC (permalink / raw)
To: ltp
This fixes statx09.c for kernel < 6.3. Previously test was skipped:
statx09.c:126: TCONF: fs-verity not supported on loopdev, due the
default block size, which is for our 300 MB loop device 1024.
This is a follow up of previous fix 2e582e743 ("statx09: Set fs-verity
blocksize to FS blocksize") for kernel >= 6.3.
Suggested-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testcases/kernel/syscalls/statx/statx09.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/statx/statx09.c b/testcases/kernel/syscalls/statx/statx09.c
index 7211d8393..6e75ff3ec 100644
--- a/testcases/kernel/syscalls/statx/statx09.c
+++ b/testcases/kernel/syscalls/statx/statx09.c
@@ -20,6 +20,7 @@
#define _GNU_SOURCE
#include <sys/mount.h>
#include <stdlib.h>
+#include <stdio.h>
#include "tst_test.h"
#include "lapi/fs.h"
#include "lapi/fsverity.h"
@@ -120,6 +121,12 @@ static void flag_setup(void)
static void setup(void)
{
+ char opt_bsize[32];
+ const char *const fs_opts[] = {"-O verity", opt_bsize, NULL};
+
+ snprintf(opt_bsize, sizeof(opt_bsize), "-b %i", getpagesize());
+ SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
+
TEST(mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL));
if (TST_RET) {
if (TST_ERR == EINVAL)
@@ -147,10 +154,9 @@ static struct tst_test test = {
.setup = setup,
.cleanup = cleanup,
.needs_root = 1,
+ .needs_device = 1,
.mntpoint = MNTPOINT,
- .format_device = 1,
.dev_fs_type = "ext4",
- .dev_fs_opts = (const char *const []){"-O verity", NULL},
.needs_kconfigs = (const char *[]) {
"CONFIG_FS_VERITY",
NULL
--
2.40.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [LTP] [PATCH 1/1] statx09: Format filesystem with page size
2023-07-17 12:54 [LTP] [PATCH 1/1] statx09: Format filesystem with page size Petr Vorel
@ 2023-07-18 14:33 ` Martin Doucha
2023-07-19 10:26 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Martin Doucha @ 2023-07-18 14:33 UTC (permalink / raw)
To: Petr Vorel, ltp
Hi,
Reviewed-by: Martin Doucha <mdoucha@suse.cz>
On 17. 07. 23 14:54, Petr Vorel wrote:
> This fixes statx09.c for kernel < 6.3. Previously test was skipped:
> statx09.c:126: TCONF: fs-verity not supported on loopdev, due the
> default block size, which is for our 300 MB loop device 1024.
>
> This is a follow up of previous fix 2e582e743 ("statx09: Set fs-verity
> blocksize to FS blocksize") for kernel >= 6.3.
>
> Suggested-by: Martin Doucha <mdoucha@suse.cz>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> testcases/kernel/syscalls/statx/statx09.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/statx/statx09.c b/testcases/kernel/syscalls/statx/statx09.c
> index 7211d8393..6e75ff3ec 100644
> --- a/testcases/kernel/syscalls/statx/statx09.c
> +++ b/testcases/kernel/syscalls/statx/statx09.c
> @@ -20,6 +20,7 @@
> #define _GNU_SOURCE
> #include <sys/mount.h>
> #include <stdlib.h>
> +#include <stdio.h>
> #include "tst_test.h"
> #include "lapi/fs.h"
> #include "lapi/fsverity.h"
> @@ -120,6 +121,12 @@ static void flag_setup(void)
>
> static void setup(void)
> {
> + char opt_bsize[32];
> + const char *const fs_opts[] = {"-O verity", opt_bsize, NULL};
> +
> + snprintf(opt_bsize, sizeof(opt_bsize), "-b %i", getpagesize());
> + SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
> +
> TEST(mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL));
> if (TST_RET) {
> if (TST_ERR == EINVAL)
> @@ -147,10 +154,9 @@ static struct tst_test test = {
> .setup = setup,
> .cleanup = cleanup,
> .needs_root = 1,
> + .needs_device = 1,
> .mntpoint = MNTPOINT,
> - .format_device = 1,
> .dev_fs_type = "ext4",
> - .dev_fs_opts = (const char *const []){"-O verity", NULL},
> .needs_kconfigs = (const char *[]) {
> "CONFIG_FS_VERITY",
> NULL
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-19 10:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 12:54 [LTP] [PATCH 1/1] statx09: Format filesystem with page size Petr Vorel
2023-07-18 14:33 ` Martin Doucha
2023-07-19 10:26 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox