* [LTP] [PATCH] SAFE_MOUNT: Fix mountflags handling for FUSE
@ 2025-06-30 12:27 Cyril Hrubis
2025-08-07 6:39 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2025-06-30 12:27 UTC (permalink / raw)
To: ltp
- abort tests on FUSE when particular mount flag is not implemented
- implement MS_RDONLY for FUSE
- enable statmount02 that failed previously because of missing MS_RDONLY
Reported-by: Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
lib/safe_macros.c | 13 +++++++++++--
testcases/kernel/syscalls/statmount/statmount02.c | 1 -
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index 6946cc5bc..726c9ae8e 100644
--- a/lib/safe_macros.c
+++ b/lib/safe_macros.c
@@ -942,10 +942,19 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
*/
if (possibly_fuse(filesystemtype)) {
char buf[1024];
+ const char *mount_ro = "";
+
+ if (mountflags & MS_RDONLY)
+ mount_ro = "-o ro";
+
+ if (mountflags & (~MS_RDONLY)) {
+ tst_brkm_(file, lineno, TBROK, cleanup_fn,
+ "FUSE mount flag(s) not implemented!");
+ }
tst_resm_(file, lineno, TINFO, "Trying FUSE...");
- snprintf(buf, sizeof(buf), "mount.%s '%s' '%s'",
- filesystemtype, source, target);
+ snprintf(buf, sizeof(buf), "mount.%s %s '%s' '%s'",
+ filesystemtype, mount_ro, source, target);
rval = tst_system(buf);
if (WIFEXITED(rval) && WEXITSTATUS(rval) == 0)
diff --git a/testcases/kernel/syscalls/statmount/statmount02.c b/testcases/kernel/syscalls/statmount/statmount02.c
index 07f877e04..f322fe930 100644
--- a/testcases/kernel/syscalls/statmount/statmount02.c
+++ b/testcases/kernel/syscalls/statmount/statmount02.c
@@ -68,7 +68,6 @@ static struct tst_test test = {
.format_device = 1,
.all_filesystems = 1,
.skip_filesystems = (const char *const []) {
- "fuse",
"btrfs",
NULL
},
--
2.49.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] SAFE_MOUNT: Fix mountflags handling for FUSE
2025-06-30 12:27 [LTP] [PATCH] SAFE_MOUNT: Fix mountflags handling for FUSE Cyril Hrubis
@ 2025-08-07 6:39 ` Petr Vorel
2025-08-08 8:21 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2025-08-07 6:39 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi all,
> - abort tests on FUSE when particular mount flag is not implemented
> - implement MS_RDONLY for FUSE
> - enable statmount02 that failed previously because of missing MS_RDONLY
I would personally split the change but understand why you want to keep it
together (it's related) and I'm ok with it. Anyway, it's important that you
remember to enable it.
> Reported-by: Signed-off-by: Jan Polensky <japo@linux.ibm.com>
very nit: I haven't seen joining tags on single line. That will break stat
scripts. And that might be the reason why Jan was noc Cc when sending with git
send-email.
Maybe change before merge:
Reported-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
or to:
Reported-by: Jan Polensky <japo@linux.ibm.com>
Co-developed-by: Jan Polensky <japo@linux.ibm.com>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
> lib/safe_macros.c | 13 +++++++++++--
> testcases/kernel/syscalls/statmount/statmount02.c | 1 -
> 2 files changed, 11 insertions(+), 3 deletions(-)
> diff --git a/lib/safe_macros.c b/lib/safe_macros.c
> index 6946cc5bc..726c9ae8e 100644
> --- a/lib/safe_macros.c
> +++ b/lib/safe_macros.c
> @@ -942,10 +942,19 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
> */
> if (possibly_fuse(filesystemtype)) {
> char buf[1024];
> + const char *mount_ro = "";
> +
> + if (mountflags & MS_RDONLY)
> + mount_ro = "-o ro";
Your version is slightly better than Jan's as it avoids duplicity.
Let's merge this one. Maybe add
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
> +
> + if (mountflags & (~MS_RDONLY)) {
> + tst_brkm_(file, lineno, TBROK, cleanup_fn,
> + "FUSE mount flag(s) not implemented!");
> + }
> tst_resm_(file, lineno, TINFO, "Trying FUSE...");
> - snprintf(buf, sizeof(buf), "mount.%s '%s' '%s'",
> - filesystemtype, source, target);
> + snprintf(buf, sizeof(buf), "mount.%s %s '%s' '%s'",
> + filesystemtype, mount_ro, source, target);
> rval = tst_system(buf);
> if (WIFEXITED(rval) && WEXITSTATUS(rval) == 0)
> diff --git a/testcases/kernel/syscalls/statmount/statmount02.c b/testcases/kernel/syscalls/statmount/statmount02.c
> index 07f877e04..f322fe930 100644
> --- a/testcases/kernel/syscalls/statmount/statmount02.c
> +++ b/testcases/kernel/syscalls/statmount/statmount02.c
> @@ -68,7 +68,6 @@ static struct tst_test test = {
> .format_device = 1,
> .all_filesystems = 1,
> .skip_filesystems = (const char *const []) {
> - "fuse",
> "btrfs",
> NULL
> },
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] SAFE_MOUNT: Fix mountflags handling for FUSE
2025-08-07 6:39 ` Petr Vorel
@ 2025-08-08 8:21 ` Petr Vorel
0 siblings, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2025-08-08 8:21 UTC (permalink / raw)
To: Cyril Hrubis, ltp
Hi all,
merged, thank you both!
https://github.com/linux-test-project/ltp/commit/52a981056de255d6f30cf2b1f0b5c809419cbdc9
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-08 8:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 12:27 [LTP] [PATCH] SAFE_MOUNT: Fix mountflags handling for FUSE Cyril Hrubis
2025-08-07 6:39 ` Petr Vorel
2025-08-08 8:21 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox