[GIT PULL 05/16 for v7.2] vfs casefold

From: Christian Brauner

Date: Fri Jun 12 2026 - 11:16:49 EST


Hey Linus,

/* Summary */

This exposes the case folding behavior of local filesystems so that
file servers - nfsd, ksmbd, and user space file servers - can report
the actual behavior to clients instead of guessing.

Filesystems report case-insensitive and case-nonpreserving behavior
via new file_kattr flags in their fileattr_get implementations. fat,
exfat, ntfs3, hfs, hfsplus, xfs, cifs, nfs, vboxsf, and isofs are
wired up; local filesystems not explicitly handled default to the
usual POSIX behavior of case-sensitive and case-preserving. nfsd uses
this to report case folding via NFSv3 PATHCONF and to implement the
NFSv4 FATTR4_CASE_INSENSITIVE and FATTR4_CASE_PRESERVING attributes -
both have been part of the NFS protocols for decades to support
clients on non-POSIX systems - and ksmbd reports it via
FS_ATTRIBUTE_INFORMATION. Exposing the information through the
fileattr uapi covers user space file servers.

The immediate motivation is interoperability: Windows NFS clients
hard-require servers to report case-insensitivity for Win32
applications to work correctly, and a client that knows the server is
case-insensitive can avoid issuing multiple LOOKUP/READDIR requests
searching for case variants. The Linux NFS client already grew
support for case-insensitive shares years ago in support of the
Hammerspace NFS server - negative dentry caching must be disabled (a
lookup for "FILE.TXT" failing must not cache a negative entry when
"file.txt" exists) and directory change invalidation must drop cached
case-folded name variants. Such servers often operate in
multi-protocol environments where a single file service instance
caters to both NFS and SMB clients, and nfsd needs to report case
folding properly to participate as a first-class citizen there.

A follow-up series brings fixes for the initial work: the nfsd
case-info probe now uses kernel credentials, maps -ESTALE to
NFS3ERR_STALE, and has its cost capped across READDIR entries; the
nfs client avoids transiently zeroed case capability bits during the
probe and skips the pathconf probe when neither field is consumed;
the FS_CASEFOLD_FL semantics are clarified in the UAPI header; and
the tools UAPI headers are synced.

Note that the nfsd tree is based on a merge of this branch so these
changes may also reach you through the nfsd pull request.

/* Testing */

gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3+b1)

No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

This has a merge conflict with the ntfs3 tree in fs/ntfs3/file.c,
fs/ntfs3/namei.c, and fs/ntfs3/ntfs_fs.h between commit eeb7b37b9700f
("ntfs3: Implement fileattr_get for case sensitivity") from this tree
and commit 245bbdd2b9d65 ("fs/ntfs3: add fileattr support") from the
ntfs3 tree. Reported with resolution in [1].

[1]: https://lore.kernel.org/linux-next/ahmF4spkQMYcQMGI@xxxxxxxxxxxxx

The following changes since commit 254f49634ee16a731174d2ae34bc50bd5f45e731:

Linux 7.1-rc1 (2026-04-26 14:19:00 -0700)

are available in the Git repository at:

git@xxxxxxxxxxxxxxxxxxx:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.2-rc1.casefold

for you to fetch changes up to ea3120fd5153c967efb20e6e3330caecbf9d8b0a:

Merge patch series "Casefold Fixes" (2026-05-15 17:49:29 +0200)

----------------------------------------------------------------
vfs-7.2-rc1.casefold

Please consider pulling these changes from the signed vfs-7.2-rc1.casefold tag.

Thanks!
Christian

----------------------------------------------------------------
Christian Brauner (2):
Merge patch series "Exposing case folding behavior"
Merge patch series "Casefold Fixes"

Chuck Lever (22):
fs: Move file_kattr initialization to callers
fs: Add case sensitivity flags to file_kattr
fat: Implement fileattr_get for case sensitivity
exfat: Implement fileattr_get for case sensitivity
ntfs3: Implement fileattr_get for case sensitivity
hfs: Implement fileattr_get for case sensitivity
hfsplus: Report case sensitivity in fileattr_get
xfs: Report case sensitivity in fileattr_get
cifs: Implement fileattr_get for case sensitivity
nfs: Implement fileattr_get for case sensitivity
vboxsf: Implement fileattr_get for case sensitivity
isofs: Implement fileattr_get for case sensitivity
nfsd: Report export case-folding via NFSv3 PATHCONF
nfsd: Implement NFSv4 FATTR4_CASE_INSENSITIVE and FATTR4_CASE_PRESERVING
ksmbd: Report filesystem case sensitivity via FS_ATTRIBUTE_INFORMATION
tools headers UAPI: Sync case-sensitivity flags from linux/fs.h
nfs: Avoid transient zeroed case capability bits during probe
nfs: Skip pathconf probe when neither field is consumed
fs: Clarify FS_CASEFOLD_FL semantics in UAPI header
nfsd: Use kernel credentials for case-info probe
nfsd: Map -ESTALE from case probe to NFS3ERR_STALE
nfsd: Cap case-folding probe cost across READDIR entries

fs/exfat/exfat_fs.h | 2 +
fs/exfat/file.c | 18 ++++-
fs/exfat/namei.c | 1 +
fs/fat/fat.h | 3 +
fs/fat/file.c | 36 +++++++++
fs/fat/namei_msdos.c | 1 +
fs/fat/namei_vfat.c | 1 +
fs/file_attr.c | 16 ++--
fs/hfs/dir.c | 1 +
fs/hfs/hfs_fs.h | 2 +
fs/hfs/inode.c | 14 ++++
fs/hfsplus/inode.c | 16 +++-
fs/isofs/dir.c | 16 ++++
fs/isofs/isofs.h | 3 +
fs/nfs/client.c | 32 +++++---
fs/nfs/inode.c | 15 ++++
fs/nfs/internal.h | 3 +
fs/nfs/namespace.c | 2 +
fs/nfs/nfs3proc.c | 2 +
fs/nfs/nfs3xdr.c | 7 +-
fs/nfs/nfs4proc.c | 10 ++-
fs/nfs/proc.c | 3 +
fs/nfs/symlink.c | 3 +
fs/nfsd/nfs3proc.c | 39 ++++++++--
fs/nfsd/nfs4xdr.c | 99 +++++++++++++++++++++++--
fs/nfsd/vfs.c | 86 +++++++++++++++++++++
fs/nfsd/vfs.h | 3 +
fs/nfsd/xdr3.h | 4 +-
fs/nfsd/xdr4.h | 14 ++++
fs/ntfs3/file.c | 29 ++++++++
fs/ntfs3/namei.c | 1 +
fs/ntfs3/ntfs_fs.h | 1 +
fs/smb/client/cifsfs.c | 53 +++++++++++++
fs/smb/client/cifsfs.h | 3 +
fs/smb/client/namespace.c | 1 +
fs/smb/server/smb2pdu.c | 30 ++++++--
fs/vboxsf/dir.c | 1 +
fs/vboxsf/file.c | 6 +-
fs/vboxsf/super.c | 7 ++
fs/vboxsf/utils.c | 30 ++++++++
fs/vboxsf/vfsmod.h | 6 ++
fs/xfs/libxfs/xfs_inode_util.c | 2 +
fs/xfs/xfs_ioctl.c | 22 +++++-
include/linux/fileattr.h | 3 +-
include/linux/nfs_fs_sb.h | 2 +-
include/linux/nfs_xdr.h | 2 +
include/uapi/linux/fs.h | 18 ++++-
tools/perf/trace/beauty/include/uapi/linux/fs.h | 7 ++
48 files changed, 618 insertions(+), 58 deletions(-)