safe_mount: Do not try mount() syscall for FUSE fs
PATCH 1/1 safe_mount: Do not try mount() syscall for FUSE fs
The problem here is that there exists two NTFS implementations. There is a readonly support in the kernel and full read/write FUSE implementation. If there is a NTFS kernel module present on the system the mount() syscall successfuly mounts the device in read-only mode which causes the tests to fail once they attempt to create a file.
---
This is one small nit I found while testing LTP I think that it's safe enough for the relese since it only touches code for ntfs and exfat.
lib/safe_macros.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
lib/safe_macros.c +7 -7
@@ -723,8 +723,6 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void), {int rval; - rval =mount (source, target, filesystemtype, mountflags, data); -/* * The FUSE filesystem executes mount.fuse helper, which tries to * execute corresponding binary name which is encoded at the start of
@@ -732,21 +730,23 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),* * The mount helpers are called mount.$fs_type. */ -if (rval ==-1 && errno ==ENODEV &&is_fuse (filesystemtype)) { +if (is_fuse (filesystemtype)) {char buf[1024 ]; -int ret;tst_resm (TINFO ,"Trying FUSE..." );snprintf (buf,sizeof (buf),"mount.%s '%s' '%s'" , filesystemtype, source, target); - ret =tst_system (buf); -if (WIFEXITED (ret) &&WEXITSTATUS (ret) ==0 ) + rval =tst_system (buf); +if (WIFEXITED (rval) &&WEXITSTATUS (rval) ==0 )return 0 ; - errno =ENODEV ; +tst_brkm (TBROK , cleanup_fn,"mount.%s failed with %i" , + filesystemtype, rval); +return -1 ; } + rval =mount (source, target, filesystemtype, mountflags, data);if (rval ==-1 ) { tst_brkm(TBROK | TERRNO, cleanup_fn, "%s:%d: mount(%s, %s, %s, %lu, %p) failed",
Signature · 1 line
2.13.6
PATCH 1/1 safe_mount: Do not try mount() syscall for FUSE fs
----- Original Message -----
Quoted 7 lines
The problem here is that there exists two NTFS implementations. There is a readonly support in the kernel and full read/write FUSE implementation. If there is a NTFS kernel module present on the system the
mount()syscall successfuly mounts the device in read-only mode which causes the tests to fail once they attempt to create a file.Signed-off-by Cyril Hrubis <[email protected]>
This would prevent test using read-only kernel version of NTFS, but no such test exists (and EROFS tests use tmpfs).
ACK
Regards,
Jan
PATCH 1/1 safe_mount: Do not try mount() syscall for FUSE fs
Hi!
Pushed along with two obvious fixed for two build failures.
Now last patch that I would like to get included in the release is:
[PATCH] tst_test: Fix exit value on tst_brk(TCONF, ...)
Can you have a quick look?
Signature · 2 lines
Cyril Hrubis [email protected]