[LTP] [PATCH] syscalls: file_attr05: skip ntfs filesystem
Cyril Hrubis
chrubis@suse.cz
Fri Apr 10 12:04:11 CEST 2026
Hi!
> > When I run the test I see:
> >
> > ...
> > tst_supported_fs_types.c:165: TINFO: Skipping FUSE based ntfs as requested by the test
> > ...
> >
> > So likely something else is at play here. Are you sure you are dealing
> > with a fuse based ntfs or with the kernel based implementation?
> >
>
> On Ubuntu, ntfs3 is available as a kernel module, so
> has_kernel_support() in tst_supported_fs_types.c probes the kernel
> mount, succeeds, and returns TST_FS_KERNEL immediately — never
> reaching the FUSE detection path. As a result, the existing "fuse"
> skip doesn't fire even though safe_macros always mounts ntfs via FUSE
> anyway.
I think I've figured it out. The ntfs driver in kernel is the old
read-only one and ntfs3 is the new read-write kernel driver.
What we can do in the library is to fix the ntfs driver to be always
handled by fuse and add ntfs3 that is the read-write kernel driver. With
that we will fix this test but also enable more coverage.
This works for me:
diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
index c619a373d..961ffc091 100644
--- a/lib/tst_mkfs.c
+++ b/lib/tst_mkfs.c
@@ -50,6 +50,9 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
return;
}
+ if (!strcmp(fs_type, "ntfs3"))
+ fs_type = "ntfs";
+
snprintf(mkfs, sizeof(mkfs), "mkfs.%s", fs_type);
if (fs_opts) {
diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index 0c8c8dc50..d3020fc48 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -30,6 +30,7 @@ static const char *const fs_type_whitelist[] = {
"vfat",
"exfat",
"ntfs",
+ "ntfs3",
"tmpfs",
NULL
};
@@ -51,6 +52,9 @@ static int has_mkfs(const char *fs_type)
return 1;
}
+ if (!strcmp(fs_type, "ntfs3"))
+ fs_type = "ntfs";
+
sprintf(buf, "mkfs.%s >/dev/null 2>&1", fs_type);
ret = tst_system(buf);
@@ -87,6 +91,9 @@ static enum tst_fs_impl has_kernel_support(const char *fs_type)
char template[PATH_MAX];
int ret;
+ if (!strcmp(fs_type, "ntfs"))
+ goto check_fuse;
+
snprintf(template, sizeof(template), "%s/mountXXXXXX", tmpdir);
if (!mkdtemp(template))
tst_brk(TBROK | TERRNO, "mkdtemp(%s) failed", template);
@@ -102,6 +109,7 @@ static enum tst_fs_impl has_kernel_support(const char *fs_type)
SAFE_RMDIR(template);
+check_fuse:
if (tst_fs_in_skiplist(fs_type, fs_type_fuse_blacklist)) {
tst_res(TINFO, "Skipping %s because of FUSE blacklist", fs_type);
return TST_FS_UNSUPPORTED;
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list