From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1] statx/statx04: Skip testing casefolded filesystems
Date: Wed, 1 Jul 2026 08:03:22 +0000 [thread overview]
Message-ID: <20260701080324.19270-1-wegao@suse.com> (raw)
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
next reply other threads:[~2026-07-01 8:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 8:03 Wei Gao via ltp [this message]
2026-07-01 9:11 ` [LTP] statx/statx04: Skip testing casefolded filesystems 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260701080324.19270-1-wegao@suse.com \
--to=ltp@lists.linux.it \
--cc=wegao@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox