SAFE_MOUNT: Fix mountflags handling for FUSE
PATCH 1/1 SAFE_MOUNT: Fix mountflags handling for FUSE
- 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
--- lib/safe_macros.c | 13 +++++++++++-- testcases/kernel/syscalls/statmount/statmount02.c | 1 - 2 files changed, 11 insertions(+), 3 deletions(-)
lib/safe_macros.c +11 -2
@@ -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 )
testcases/kernel/syscalls/statmount/statmount02.c +0 -1
@@ -68,7 +68,6 @@ static struct tst_test test = { .format_device = 1, .all_filesystems = 1, .skip_filesystems = (const char *const []) { -"fuse" ,"btrfs" ,NULL },
Signature · 5 lines
2.49.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
Quoted 3 lines
- abort tests on FUSE when particular mount flag is not implemented
- implementMS_RDONLYfor FUSE
- enable statmount02 that failed previously because of missingMS_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.
Quoted 1 line
Reported-by Signed-off-by: Jan Polensky <[email protected]>
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:
or to:
Quoted 11 lines
Signed-off-by Cyril Hrubis <[email protected]>--- lib/safe_macros.c | 13 +++++++++++-- testcases/kernel/syscalls/statmount/statmount02.c | 1 - 2 files changed, 11 insertions(+), 3 deletions(-)lib/safe_macros.c +0
-0
lib/safe_macros.c int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void), · line 948
Quoted 7 lines
lib/safe_macros.c +4
-0@@ -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
Kind regards,
Petr
Quoted 26 lines
lib/safe_macros.c +7
-2+ +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 )testcases/kernel/syscalls/statmount/statmount02.c +0
-1@@ -68,7 +68,6 @@ static struct tst_test test = { .format_device = 1, .all_filesystems = 1, .skip_filesystems = (const char *const []) { -"fuse" ,"btrfs" ,NULL },
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
merged, thank you both!
https://github.com/linux-test-project/ltp/commit/52a981056de255d6f30cf2b1f0b5c809419cbdc9
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp