All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] statx/statx04: Skip testing casefolded filesystems
@ 2026-07-01  8:03 Wei Gao via ltp
  2026-07-01  9:11 ` [LTP] " linuxtestproject.agent
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Wei Gao via ltp @ 2026-07-01  8:03 UTC (permalink / raw)
  To: ltp

On newer kernels (v7.1-rc1+), vfat and exfat implement fileattr_get to
support reporting casefolding. This causes the FS_IOC_GETFLAGS ioctl to
return success with FS_CASEFOLD_FL set, whereas on older kernels it
returned ENOTTY.

Since FS_IOC_GETFLAGS succeeds, statx04 assumes standard writable inode
attributes (append, immutable, nodump) are supported on these
filesystems. However, they are not, causing the statx() attribute check
to fail with TFAIL.

Fix this by checking if the retrieved flags contain FS_CASEFOLD_FL,
and if so, skip the test with TCONF. Additionally, define
FS_CASEFOLD_FL in include/lapi/fs.h for compatibility with older
user-space headers.

This addresses the failures introduced by the following upstream Linux
kernel commits:
- 27e0b573dd4a ("exfat: Implement fileattr_get for case sensitivity")
- c92db2ca72fe ("fat: Implement fileattr_get for case sensitivity")

Signed-off-by: Wei Gao <wegao@suse.com>
---
 include/lapi/fs.h                         |  4 ++++
 testcases/kernel/syscalls/statx/statx04.c | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/include/lapi/fs.h b/include/lapi/fs.h
index 471ad0a25..0e2ed6e2d 100644
--- a/include/lapi/fs.h
+++ b/include/lapi/fs.h
@@ -69,6 +69,10 @@ struct fsxattr {
 # define FS_VERITY_FL	   0x00100000 /* Verity protected inode */
 #endif
 
+#ifndef FS_CASEFOLD_FL
+# define FS_CASEFOLD_FL    0x40000000 /* Folder is case insensitive */
+#endif
+
 #ifndef FS_XFLAG_APPEND
 # define FS_XFLAG_APPEND	0x00000010	/* all writes append */
 #endif
diff --git a/testcases/kernel/syscalls/statx/statx04.c b/testcases/kernel/syscalls/statx/statx04.c
index af30a200e..a4b663d2c 100644
--- a/testcases/kernel/syscalls/statx/statx04.c
+++ b/testcases/kernel/syscalls/statx/statx04.c
@@ -91,6 +91,16 @@ static void setup(void)
 	if (TST_RET)
 		tst_brk(TBROK | TTERRNO, "Unexpected ioctl() error");
 
+	/*
+	 * On newer kernels (v7.1-rc1+), vfat and exfat implement fileattr_get
+	 * to support reporting casefolding, which causes FS_IOC_GETFLAGS to
+	 * return success with FS_CASEFOLD_FL. However, they do not support
+	 * standard writable inode attributes (append, immutable, nodump).
+	 * Check FS_CASEFOLD_FL to gracefully skip them.
+	 */
+	if (i & FS_CASEFOLD_FL)
+		tst_brk(TCONF, "Casefolded directories/filesystems are not supported for this test");
+
 	for (i = 0, expected_mask = 0; i < ARRAY_SIZE(attr_list); i++)
 		expected_mask |= attr_list[i].attr;
 
-- 
2.54.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-07-05 18:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01  8:03 [LTP] [PATCH v1] statx/statx04: Skip testing casefolded filesystems Wei Gao via ltp
2026-07-01  9:11 ` [LTP] " linuxtestproject.agent
2026-07-02 11:43 ` [LTP] [PATCH v1] " Andrea Cervesato via ltp
2026-07-02 11:48   ` Andrea Cervesato via ltp
2026-07-02 13:00     ` Wei Gao via ltp
2026-07-02 13:09       ` Andrea Cervesato via ltp
2026-07-03  1:57 ` [LTP] [PATCH v2] statx/statx04: Skip vfat and exfat filesystems Wei Gao via ltp
2026-07-03  2:56   ` [LTP] " linuxtestproject.agent
2026-07-03 10:44   ` [LTP] [PATCH v2] " Avinesh Kumar via ltp
2026-07-03 12:59   ` [LTP] [PATCH v3] " Wei Gao via ltp
2026-07-03 15:14     ` [LTP] " linuxtestproject.agent
2026-07-05 18:45     ` [LTP] [PATCH v3] " Avinesh Kumar via ltp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.