]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs: Clarify FS_CASEFOLD_FL semantics in UAPI header
authorChuck Lever <chuck.lever@oracle.com>
Fri, 15 May 2026 15:35:12 +0000 (11:35 -0400)
committerChristian Brauner <brauner@kernel.org>
Fri, 15 May 2026 15:49:23 +0000 (17:49 +0200)
The existing one-liner "Folder is case insensitive" leaves the
impression that FS_CASEFOLD_FL is reserved for directories.
That impression is wrong: filesystems that derive
case-insensitivity from mount or volume state report the bit on
non-directory inodes via i_op->fileattr_get, so userspace
inspecting FS_IOC_GETFLAGS can see it on any inode type.

Replace the one-liner with a block comment that names directories
as the typical case, records that non-directory inodes may also
report the bit, and notes FS_XFLAG_CASEFOLD as the read-only
companion exposed through FS_IOC_FSGETXATTR.

Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260507-case-sensitivity-v14-0-e62cc8200435@oracle.com?part=3
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Link: https://patch.msgid.link/20260515153515.362266-5-cel@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/uapi/linux/fs.h

index 2ea4c81df08f10f18b5b2dbce3f0f4fc929ff212..bd87262f2e349482a4a68d6bb2815cdd6a26ed3f 100644 (file)
@@ -395,7 +395,16 @@ struct file_attr {
 #define FS_DAX_FL                      0x02000000 /* Inode is DAX */
 #define FS_INLINE_DATA_FL              0x10000000 /* Reserved for ext4 */
 #define FS_PROJINHERIT_FL              0x20000000 /* Create with parents projid */
-#define FS_CASEFOLD_FL                 0x40000000 /* Folder is case insensitive */
+/*
+ * FS_CASEFOLD_FL indicates case-insensitive name lookup. The
+ * bit is most often reported on directories, where it controls
+ * lookups of entries within. Filesystems that derive
+ * case-insensitivity from mount or volume state may also report
+ * it on non-directory inodes; userspace must not assume the bit
+ * is directory-only. FS_XFLAG_CASEFOLD reports the same
+ * information read-only via FS_IOC_FSGETXATTR.
+ */
+#define FS_CASEFOLD_FL                 0x40000000
 #define FS_RESERVED_FL                 0x80000000 /* reserved for ext2 lib */
 
 #define FS_FL_USER_VISIBLE             0x0003DFFF /* User visible flags */