* [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device
@ 2025-06-30 15:32 Cyril Hrubis
2025-06-30 15:32 ` [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE Cyril Hrubis
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Cyril Hrubis @ 2025-06-30 15:32 UTC (permalink / raw)
To: ltp
This allows us to adjust tests that need different expectations on FUSE
based filesystems.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
include/old/safe_macros.h | 2 +-
include/safe_macros_fn.h | 2 +-
include/tst_device.h | 2 ++
include/tst_safe_macros.h | 7 ++++++-
lib/safe_macros.c | 10 ++++++++--
lib/tst_test.c | 4 ++--
6 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/include/old/safe_macros.h b/include/old/safe_macros.h
index fb1d7a110..307843ab0 100644
--- a/include/old/safe_macros.h
+++ b/include/old/safe_macros.h
@@ -150,7 +150,7 @@
#define SAFE_MOUNT(cleanup_fn, source, target, filesystemtype, \
mountflags, data) \
safe_mount(__FILE__, __LINE__, (cleanup_fn), (source), (target), \
- (filesystemtype), (mountflags), (data))
+ (filesystemtype), (mountflags), (data), NULL)
#define SAFE_UMOUNT(cleanup_fn, target) \
safe_umount(__FILE__, __LINE__, (cleanup_fn), (target))
diff --git a/include/safe_macros_fn.h b/include/safe_macros_fn.h
index d256091b7..b4be482c1 100644
--- a/include/safe_macros_fn.h
+++ b/include/safe_macros_fn.h
@@ -172,7 +172,7 @@ int safe_rename(const char *file, const int lineno, void (*cleanup_fn)(void),
int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
const char *source, const char *target,
const char *filesystemtype, unsigned long mountflags,
- const void *data);
+ const void *data, int *is_fuse);
int safe_umount(const char *file, const int lineno, void (*cleanup_fn)(void),
const char *target);
diff --git a/include/tst_device.h b/include/tst_device.h
index 2597fb4e2..9ca802735 100644
--- a/include/tst_device.h
+++ b/include/tst_device.h
@@ -15,6 +15,8 @@ struct tst_device {
const char *dev;
const char *fs_type;
uint64_t size;
+ /* If device was mounted by the test library this flag is set for fuse fileystems. */
+ int is_fuse;
};
/*
diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h
index 19504beb5..6d53c0bbc 100644
--- a/include/tst_safe_macros.h
+++ b/include/tst_safe_macros.h
@@ -241,7 +241,12 @@ int safe_getgroups(const char *file, const int lineno, int size, gid_t list[]);
#define SAFE_MOUNT(source, target, filesystemtype, \
mountflags, data) \
safe_mount(__FILE__, __LINE__, NULL, (source), (target), \
- (filesystemtype), (mountflags), (data))
+ (filesystemtype), (mountflags), (data), NULL)
+
+#define SAFE_MOUNT2(source, target, filesystemtype, \
+ mountflags, data, is_fuse) \
+ safe_mount(__FILE__, __LINE__, NULL, (source), (target), \
+ (filesystemtype), (mountflags), (data), (is_fuse))
#define SAFE_UMOUNT(target) \
safe_umount(__FILE__, __LINE__, NULL, (target))
diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index 726c9ae8e..6d267522f 100644
--- a/lib/safe_macros.c
+++ b/lib/safe_macros.c
@@ -907,11 +907,14 @@ static int possibly_fuse(const char *fs_type)
int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
const char *source, const char *target,
const char *filesystemtype, unsigned long mountflags,
- const void *data)
+ const void *data, int *is_fuse)
{
int rval = -1;
char mpath[PATH_MAX];
+ if (is_fuse)
+ *is_fuse = 0;
+
if (realpath(target, mpath)) {
tst_resm_(file, lineno, TINFO,
"Mounting %s to %s fstyp=%s flags=%lx",
@@ -957,8 +960,11 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
filesystemtype, mount_ro, source, target);
rval = tst_system(buf);
- if (WIFEXITED(rval) && WEXITSTATUS(rval) == 0)
+ if (WIFEXITED(rval) && WEXITSTATUS(rval) == 0) {
+ if (is_fuse)
+ *is_fuse = 1;
return 0;
+ }
tst_brkm_(file, lineno, TBROK, cleanup_fn,
"mount.%s failed with %i", filesystemtype, rval);
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 17ce91932..2130e4be8 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1273,8 +1273,8 @@ static void prepare_device(struct tst_fs *fs)
mnt_data = limit_tmpfs_mount_size(fs->mnt_data,
buf, sizeof(buf), tdev.fs_type);
- SAFE_MOUNT(get_device_name(tdev.fs_type), tst_test->mntpoint,
- tdev.fs_type, fs->mnt_flags, mnt_data);
+ SAFE_MOUNT2(get_device_name(tdev.fs_type), tst_test->mntpoint,
+ tdev.fs_type, fs->mnt_flags, mnt_data, &tdev.is_fuse);
context->mntpoint_mounted = 1;
}
}
--
2.49.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE
2025-06-30 15:32 [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
@ 2025-06-30 15:32 ` Cyril Hrubis
2025-07-02 13:26 ` Wei Gao via ltp
2025-08-29 13:01 ` Li Wang via ltp
2025-07-01 13:21 ` [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
` (2 subsequent siblings)
3 siblings, 2 replies; 10+ messages in thread
From: Cyril Hrubis @ 2025-06-30 15:32 UTC (permalink / raw)
To: ltp
Reported-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/syscalls/statmount/statmount06.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/testcases/kernel/syscalls/statmount/statmount06.c b/testcases/kernel/syscalls/statmount/statmount06.c
index fe41d5b87..89717a3fb 100644
--- a/testcases/kernel/syscalls/statmount/statmount06.c
+++ b/testcases/kernel/syscalls/statmount/statmount06.c
@@ -36,8 +36,10 @@ static void run(void)
if (!TST_PASS)
return;
+ const char *fs_type = tst_device->is_fuse ? "fuseblk" : tst_device->fs_type;
+
TST_EXP_EQ_LI(st_mount->mask, STATMOUNT_FS_TYPE);
- TST_EXP_EQ_STR(st_mount->str + st_mount->fs_type, tst_device->fs_type);
+ TST_EXP_EQ_STR(st_mount->str + st_mount->fs_type, fs_type);
}
static void setup(void)
@@ -55,10 +57,6 @@ static struct tst_test test = {
.mount_device = 1,
.mntpoint = MNTPOINT,
.all_filesystems = 1,
- .skip_filesystems = (const char *const []) {
- "fuse",
- NULL
- },
.bufs = (struct tst_buffers []) {
{&st_mount, .size = SM_SIZE},
{}
--
2.49.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device
2025-06-30 15:32 [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
2025-06-30 15:32 ` [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE Cyril Hrubis
@ 2025-07-01 13:21 ` Cyril Hrubis
2025-08-29 10:23 ` Cyril Hrubis
2025-07-02 13:18 ` Wei Gao via ltp
2025-08-29 13:00 ` Li Wang via ltp
3 siblings, 1 reply; 10+ messages in thread
From: Cyril Hrubis @ 2025-07-01 13:21 UTC (permalink / raw)
To: ltp
Hi!
FYI the CI fails here because it needs to be applied over the first
patch for SAFE_MOUNT(). I should have probably send the changes as a
single patcheset.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device
2025-06-30 15:32 [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
2025-06-30 15:32 ` [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE Cyril Hrubis
2025-07-01 13:21 ` [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
@ 2025-07-02 13:18 ` Wei Gao via ltp
2025-09-09 12:05 ` Cyril Hrubis
2025-08-29 13:00 ` Li Wang via ltp
3 siblings, 1 reply; 10+ messages in thread
From: Wei Gao via ltp @ 2025-07-02 13:18 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
On Mon, Jun 30, 2025 at 05:32:04PM +0200, Cyril Hrubis wrote:
> This allows us to adjust tests that need different expectations on FUSE
> based filesystems.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Very nit: Reported-by: Jan Polensky <japo@linux.ibm.com>
Is there any issue link can be provide?
> ---
> include/old/safe_macros.h | 2 +-
> include/safe_macros_fn.h | 2 +-
> include/tst_device.h | 2 ++
> include/tst_safe_macros.h | 7 ++++++-
> lib/safe_macros.c | 10 ++++++++--
> lib/tst_test.c | 4 ++--
> 6 files changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/include/old/safe_macros.h b/include/old/safe_macros.h
> index fb1d7a110..307843ab0 100644
> --- a/include/old/safe_macros.h
> +++ b/include/old/safe_macros.h
> @@ -150,7 +150,7 @@
> #define SAFE_MOUNT(cleanup_fn, source, target, filesystemtype, \
> mountflags, data) \
> safe_mount(__FILE__, __LINE__, (cleanup_fn), (source), (target), \
> - (filesystemtype), (mountflags), (data))
> + (filesystemtype), (mountflags), (data), NULL)
>
> #define SAFE_UMOUNT(cleanup_fn, target) \
> safe_umount(__FILE__, __LINE__, (cleanup_fn), (target))
> diff --git a/include/safe_macros_fn.h b/include/safe_macros_fn.h
> index d256091b7..b4be482c1 100644
> --- a/include/safe_macros_fn.h
> +++ b/include/safe_macros_fn.h
> @@ -172,7 +172,7 @@ int safe_rename(const char *file, const int lineno, void (*cleanup_fn)(void),
> int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
> const char *source, const char *target,
> const char *filesystemtype, unsigned long mountflags,
> - const void *data);
> + const void *data, int *is_fuse);
>
> int safe_umount(const char *file, const int lineno, void (*cleanup_fn)(void),
> const char *target);
> diff --git a/include/tst_device.h b/include/tst_device.h
> index 2597fb4e2..9ca802735 100644
> --- a/include/tst_device.h
> +++ b/include/tst_device.h
> @@ -15,6 +15,8 @@ struct tst_device {
> const char *dev;
> const char *fs_type;
> uint64_t size;
> + /* If device was mounted by the test library this flag is set for fuse fileystems. */
> + int is_fuse;
> };
>
> /*
> diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h
> index 19504beb5..6d53c0bbc 100644
> --- a/include/tst_safe_macros.h
> +++ b/include/tst_safe_macros.h
> @@ -241,7 +241,12 @@ int safe_getgroups(const char *file, const int lineno, int size, gid_t list[]);
> #define SAFE_MOUNT(source, target, filesystemtype, \
> mountflags, data) \
> safe_mount(__FILE__, __LINE__, NULL, (source), (target), \
> - (filesystemtype), (mountflags), (data))
> + (filesystemtype), (mountflags), (data), NULL)
> +
> +#define SAFE_MOUNT2(source, target, filesystemtype, \
> + mountflags, data, is_fuse) \
> + safe_mount(__FILE__, __LINE__, NULL, (source), (target), \
> + (filesystemtype), (mountflags), (data), (is_fuse))
>
> #define SAFE_UMOUNT(target) \
> safe_umount(__FILE__, __LINE__, NULL, (target))
> diff --git a/lib/safe_macros.c b/lib/safe_macros.c
> index 726c9ae8e..6d267522f 100644
> --- a/lib/safe_macros.c
> +++ b/lib/safe_macros.c
> @@ -907,11 +907,14 @@ static int possibly_fuse(const char *fs_type)
> int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
> const char *source, const char *target,
> const char *filesystemtype, unsigned long mountflags,
> - const void *data)
> + const void *data, int *is_fuse)
> {
> int rval = -1;
> char mpath[PATH_MAX];
>
> + if (is_fuse)
> + *is_fuse = 0;
> +
> if (realpath(target, mpath)) {
> tst_resm_(file, lineno, TINFO,
> "Mounting %s to %s fstyp=%s flags=%lx",
> @@ -957,8 +960,11 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
> filesystemtype, mount_ro, source, target);
>
> rval = tst_system(buf);
> - if (WIFEXITED(rval) && WEXITSTATUS(rval) == 0)
> + if (WIFEXITED(rval) && WEXITSTATUS(rval) == 0) {
> + if (is_fuse)
> + *is_fuse = 1;
> return 0;
> + }
>
> tst_brkm_(file, lineno, TBROK, cleanup_fn,
> "mount.%s failed with %i", filesystemtype, rval);
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 17ce91932..2130e4be8 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1273,8 +1273,8 @@ static void prepare_device(struct tst_fs *fs)
> mnt_data = limit_tmpfs_mount_size(fs->mnt_data,
> buf, sizeof(buf), tdev.fs_type);
>
> - SAFE_MOUNT(get_device_name(tdev.fs_type), tst_test->mntpoint,
> - tdev.fs_type, fs->mnt_flags, mnt_data);
> + SAFE_MOUNT2(get_device_name(tdev.fs_type), tst_test->mntpoint,
> + tdev.fs_type, fs->mnt_flags, mnt_data, &tdev.is_fuse);
> context->mntpoint_mounted = 1;
> }
> }
> --
> 2.49.0
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE
2025-06-30 15:32 ` [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE Cyril Hrubis
@ 2025-07-02 13:26 ` Wei Gao via ltp
2025-09-09 12:09 ` Cyril Hrubis
2025-08-29 13:01 ` Li Wang via ltp
1 sibling, 1 reply; 10+ messages in thread
From: Wei Gao via ltp @ 2025-07-02 13:26 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
On Mon, Jun 30, 2025 at 05:32:05PM +0200, Cyril Hrubis wrote:
> Reported-by: Jan Polensky <japo@linux.ibm.com>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
> testcases/kernel/syscalls/statmount/statmount06.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/statmount/statmount06.c b/testcases/kernel/syscalls/statmount/statmount06.c
> index fe41d5b87..89717a3fb 100644
> --- a/testcases/kernel/syscalls/statmount/statmount06.c
> +++ b/testcases/kernel/syscalls/statmount/statmount06.c
> @@ -36,8 +36,10 @@ static void run(void)
> if (!TST_PASS)
> return;
>
> + const char *fs_type = tst_device->is_fuse ? "fuseblk" : tst_device->fs_type;
> +
> TST_EXP_EQ_LI(st_mount->mask, STATMOUNT_FS_TYPE);
> - TST_EXP_EQ_STR(st_mount->str + st_mount->fs_type, tst_device->fs_type);
> + TST_EXP_EQ_STR(st_mount->str + st_mount->fs_type, fs_type);
> }
>
> static void setup(void)
> @@ -55,10 +57,6 @@ static struct tst_test test = {
> .mount_device = 1,
> .mntpoint = MNTPOINT,
> .all_filesystems = 1,
> - .skip_filesystems = (const char *const []) {
> - "fuse",
> - NULL
> - },
> .bufs = (struct tst_buffers []) {
> {&st_mount, .size = SM_SIZE},
> {}
> --
> 2.49.0
Reviewed-by: Wei Gao <wegao@suse.com>
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device
2025-07-01 13:21 ` [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
@ 2025-08-29 10:23 ` Cyril Hrubis
0 siblings, 0 replies; 10+ messages in thread
From: Cyril Hrubis @ 2025-08-29 10:23 UTC (permalink / raw)
To: ltp
Hi!
> FYI the CI fails here because it needs to be applied over the first
> patch for SAFE_MOUNT(). I should have probably send the changes as a
> single patcheset.
Ping. Can anyone have a look please?
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device
2025-06-30 15:32 [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
` (2 preceding siblings ...)
2025-07-02 13:18 ` Wei Gao via ltp
@ 2025-08-29 13:00 ` Li Wang via ltp
3 siblings, 0 replies; 10+ messages in thread
From: Li Wang via ltp @ 2025-08-29 13:00 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
On Mon, Jun 30, 2025 at 11:32 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> This allows us to adjust tests that need different expectations on FUSE
> based filesystems.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
>
Reviewed-by: Li Wang <liwang@redhat.com>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE
2025-06-30 15:32 ` [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE Cyril Hrubis
2025-07-02 13:26 ` Wei Gao via ltp
@ 2025-08-29 13:01 ` Li Wang via ltp
1 sibling, 0 replies; 10+ messages in thread
From: Li Wang via ltp @ 2025-08-29 13:01 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
On Mon, Jun 30, 2025 at 11:31 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> Reported-by: Jan Polensky <japo@linux.ibm.com>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
>
Reviewed-by: Li Wang <liwang@redhat.com>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device
2025-07-02 13:18 ` Wei Gao via ltp
@ 2025-09-09 12:05 ` Cyril Hrubis
0 siblings, 0 replies; 10+ messages in thread
From: Cyril Hrubis @ 2025-09-09 12:05 UTC (permalink / raw)
To: Wei Gao; +Cc: ltp
Hi!
> > Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> Very nit: Reported-by: Jan Polensky <japo@linux.ibm.com>
Added.
> Is there any issue link can be provide?
Unfortunately no.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE
2025-07-02 13:26 ` Wei Gao via ltp
@ 2025-09-09 12:09 ` Cyril Hrubis
0 siblings, 0 replies; 10+ messages in thread
From: Cyril Hrubis @ 2025-09-09 12:09 UTC (permalink / raw)
To: Wei Gao; +Cc: ltp
Hi!
Patchset pushed, thanks for the reviews.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-09-09 12:08 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 15:32 [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
2025-06-30 15:32 ` [LTP] [PATCH 2/2] syscalls/statmount06: Fix and enable the test on FUSE Cyril Hrubis
2025-07-02 13:26 ` Wei Gao via ltp
2025-09-09 12:09 ` Cyril Hrubis
2025-08-29 13:01 ` Li Wang via ltp
2025-07-01 13:21 ` [LTP] [PATCH 1/2] lib: Add is_fuse flag to SAFE_MOUNT() and tst_device Cyril Hrubis
2025-08-29 10:23 ` Cyril Hrubis
2025-07-02 13:18 ` Wei Gao via ltp
2025-09-09 12:05 ` Cyril Hrubis
2025-08-29 13:00 ` 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