* [LTP] [PATCH] lib: Treat kernel ntfs3 as a separate FS
@ 2026-04-13 11:51 Cyril Hrubis
2026-04-13 12:22 ` [LTP] " linuxtestproject.agent
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Cyril Hrubis @ 2026-04-13 11:51 UTC (permalink / raw)
To: ltp; +Cc: Matt Ochs
The RW NTFS support for Linux kernel was added back in 2021 in a form of
ntfs3 driver. The old RO NTFS functionality was retained though, hence
if we mount a filesystem with type "ntfs" we read it read-only. On the
top of that there is NTFS fuse implementation as well.
Historically we ignored the kernel NTFS filesystem and went for FUSE
since there is not much we can do with read-only filesystem and the code
stayed like that even after kernel RW support was added. At that point
we should have enabled both kernel NTFS driver and fuse NTFS driver and
treat them as a different filesystem in order to maximize the coverage.
Meanwhile this even caused failures, which is how this issue finaly
surfaced with a fuse based NTFS not being skipped properly because the
test library got confused with having both kernel and fuse NTFS
available.
This patch finally fixes all of that by splitting the fuse and kernel
NTFS support into two separate filesystems (as seen by the test
library).
The kernel RW filesystem is called ntfs3 while the fuse based one is
callled just ntfs. For that to happen we need to:
- add new ntfs3 fs to the whitelist
- map ntfs3 to ntfs for mkfs
- jump directly to fuse for ntfs fs in the fs support check
(we jump directly to fuse in the safe_mount() already)
As a side effect we fixed file_attr05 test to be properly skipped on
fuse NTFS.
Reported-by: Matt Ochs <mochs@nvidia.com>
Tested-by: Matt Ochs <mochs@nvidia.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
lib/tst_mkfs.c | 3 +++
lib/tst_supported_fs_types.c | 8 ++++++++
2 files changed, 11 insertions(+)
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;
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] lib: Treat kernel ntfs3 as a separate FS
2026-04-13 11:51 [LTP] [PATCH] lib: Treat kernel ntfs3 as a separate FS Cyril Hrubis
@ 2026-04-13 12:22 ` linuxtestproject.agent
2026-04-13 14:36 ` Cyril Hrubis
2026-04-14 8:58 ` [LTP] [PATCH] " Avinesh Kumar via ltp
2026-04-16 15:43 ` Cyril Hrubis
2 siblings, 1 reply; 6+ messages in thread
From: linuxtestproject.agent @ 2026-04-13 12:22 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
our agent completed the review of the patch.
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
On Mon, 13 Apr 2026, Cyril Hrubis wrote:
> lib: Treat kernel ntfs3 as a separate FS
> Meanwhile this even caused failures, which is how this issue finaly
> surfaced with a fuse based NTFS not being skipped properly because the
> test library got confused with having both kernel and fuse NTFS
> available.
Two typos: "finaly" -> "finally", "callled" -> "called" (a few lines
below).
Since this fixes a real failure, please consider adding a Fixes: tag
pointing to the LTP commit that introduced the broken ntfs handling. If
the issue predates any single identifiable commit, dropping the tag is
fine — just clarify in the reply.
[...]
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] lib: Treat kernel ntfs3 as a separate FS
2026-04-13 12:22 ` [LTP] " linuxtestproject.agent
@ 2026-04-13 14:36 ` Cyril Hrubis
2026-04-13 21:24 ` Petr Vorel
0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2026-04-13 14:36 UTC (permalink / raw)
To: linuxtestproject.agent; +Cc: ltp
Hi!
> > lib: Treat kernel ntfs3 as a separate FS
>
> > Meanwhile this even caused failures, which is how this issue finaly
> > surfaced with a fuse based NTFS not being skipped properly because the
> > test library got confused with having both kernel and fuse NTFS
> > available.
>
> Two typos: "finaly" -> "finally", "callled" -> "called" (a few lines
> below).
I will fix these before commiting.
> Since this fixes a real failure, please consider adding a Fixes: tag
> pointing to the LTP commit that introduced the broken ntfs handling. If
> the issue predates any single identifiable commit, dropping the tag is
> fine — just clarify in the reply.
However this one is more complex, there isn't a single patch that caused
the problem, moreover it was triggered only by addition of the ntfs3
driver into the kernel.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] lib: Treat kernel ntfs3 as a separate FS
2026-04-13 14:36 ` Cyril Hrubis
@ 2026-04-13 21:24 ` Petr Vorel
0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2026-04-13 21:24 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp, linuxtestproject.agent
Hi Cyril,
> Hi!
> > > lib: Treat kernel ntfs3 as a separate FS
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Great idea, thanks!
> > > Meanwhile this even caused failures, which is how this issue finaly
> > > surfaced with a fuse based NTFS not being skipped properly because the
> > > test library got confused with having both kernel and fuse NTFS
> > > available.
> > Two typos: "finaly" -> "finally", "callled" -> "called" (a few lines
> > below).
> I will fix these before commiting.
> > Since this fixes a real failure, please consider adding a Fixes: tag
> > pointing to the LTP commit that introduced the broken ntfs handling. If
> > the issue predates any single identifiable commit, dropping the tag is
> > fine — just clarify in the reply.
> However this one is more complex, there isn't a single patch that caused
> the problem, moreover it was triggered only by addition of the ntfs3
> driver into the kernel.
+1.
Trying, if patchwork / b4 takes this tag (link to lore). It'd be great if we had
tooling patchwork.kernel.org + git.kernel.org have so that we would not have to
add it manually.
Link: https://lore.kernel.org/ltp/20260413115129.30239-1-chrubis@suse.cz/
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] lib: Treat kernel ntfs3 as a separate FS
2026-04-13 11:51 [LTP] [PATCH] lib: Treat kernel ntfs3 as a separate FS Cyril Hrubis
2026-04-13 12:22 ` [LTP] " linuxtestproject.agent
@ 2026-04-14 8:58 ` Avinesh Kumar via ltp
2026-04-16 15:43 ` Cyril Hrubis
2 siblings, 0 replies; 6+ messages in thread
From: Avinesh Kumar via ltp @ 2026-04-14 8:58 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi,
Tested-by: Avinesh Kumar <avinesh.kumar@suse.com>
Reviewed-by: Avinesh Kumar <avinesh.kumar@suse.com>
Regards,
Avinesh
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH] lib: Treat kernel ntfs3 as a separate FS
2026-04-13 11:51 [LTP] [PATCH] lib: Treat kernel ntfs3 as a separate FS Cyril Hrubis
2026-04-13 12:22 ` [LTP] " linuxtestproject.agent
2026-04-14 8:58 ` [LTP] [PATCH] " Avinesh Kumar via ltp
@ 2026-04-16 15:43 ` Cyril Hrubis
2 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2026-04-16 15:43 UTC (permalink / raw)
To: ltp; +Cc: Matt Ochs
Hi!
Thanks for the reviews and testing, pushed.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-04-16 15:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13 11:51 [LTP] [PATCH] lib: Treat kernel ntfs3 as a separate FS Cyril Hrubis
2026-04-13 12:22 ` [LTP] " linuxtestproject.agent
2026-04-13 14:36 ` Cyril Hrubis
2026-04-13 21:24 ` Petr Vorel
2026-04-14 8:58 ` [LTP] [PATCH] " Avinesh Kumar via ltp
2026-04-16 15:43 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox