]> git.ipfire.org Git - thirdparty/linux.git/commit
fs: Add case sensitivity flags to file_kattr
authorChuck Lever <chuck.lever@oracle.com>
Thu, 7 May 2026 08:52:55 +0000 (04:52 -0400)
committerChristian Brauner <brauner@kernel.org>
Mon, 11 May 2026 14:50:27 +0000 (16:50 +0200)
commit3035e4454142327ec5faee2ff57ab7cb1e9fc712
treeca38a17f171306cae5f3302333382e2543db4af3
parent14c3197ecf074549429b12b60e2a0a3fb875f75f
fs: Add case sensitivity flags to file_kattr

Enable upper layers such as NFSD to retrieve case sensitivity
information from file systems by adding FS_XFLAG_CASEFOLD and
FS_XFLAG_CASENONPRESERVING flags.

Filesystems report case-insensitive or case-nonpreserving behavior
by setting these flags directly in fa->fsx_xflags. The default
(flags unset) indicates POSIX semantics: case-sensitive and
case-preserving. Both flags are added to FS_XFLAG_RDONLY_MASK so
FS_IOC_FSSETXATTR silently strips them, keeping the new xflags
strictly a reporting interface. Callers that want to toggle
casefolding continue to use FS_IOC_SETFLAGS with FS_CASEFOLD_FL,
the established UAPI on filesystems that support the operation
(ext4 and f2fs on empty directories).

Case sensitivity information is exported to userspace via the
fa_xflags field in the FS_IOC_FSGETXATTR ioctl and file_getattr()
system call.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Link: https://patch.msgid.link/20260507-case-sensitivity-v14-2-e62cc8200435@oracle.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/file_attr.c
include/linux/fileattr.h
include/uapi/linux/fs.h