Linux 7.2 To Better Communicate File-System Casefolding For Helping Windows NFS & More

Enhancements in Linux 7.2 Kernel for Case-Folding Behavior Reporting

The latest developments in the Linux 7.2 kernel have introduced a significant enhancement regarding the reporting of case-folding behavior in local file systems. This improvement aims to provide clarity for Linux file servers, enabling them to accurately convey their case sensitivity capabilities rather than relying on assumptions.

Linus Torvalds has recently merged a series of Virtual File System (VFS) related pull requests that include this crucial functionality. Among the key updates is the ability for local file systems to report their case-folding behavior effectively, which is particularly beneficial for services such as NFSD, KSMBD, and various user-space servers. The impetus behind this initiative is to meet the specific requirements of Microsoft Windows NFS clients.

Christian Brauner elaborated on the significance of this case-folding work for Linux 7.2, stating:

“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 filekattr flags in their fileattrget implementations. FAT, exFAT, NTFS3, HFS, HFS+, 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 FATTR4CASEINSENSITIVE and FATTR4CASEPRESERVING attributes – both have been part of the NFS protocols for decades to support clients on non-POSIX systems – and ksmbd reports it via FSATTRIBUTEINFORMATION. Exposing the information through the fileattr uapi covers user space file servers.”

The primary motivation behind these enhancements is interoperability. Windows NFS clients necessitate that servers report case-insensitivity for Win32 applications to function correctly. When a client is aware that the server is case-insensitive, it can streamline operations by avoiding multiple LOOKUP/READDIR requests in search of case variants. The Linux NFS client has previously incorporated support for case-insensitive shares, particularly in collaboration with the Hammerspace NFS server. This requires disabling negative dentry caching, ensuring that a failed lookup for “FILE.TXT” does not cache a negative entry when “file.txt” exists. Additionally, directory change invalidation must eliminate cached case-folded name variants.

Such servers frequently operate within multi-protocol environments, where a single file service instance accommodates both NFS and SMB clients. Consequently, it is essential for nfsd to accurately report case folding to maintain its status as a first-class participant in these ecosystems.

This recent merge marks a significant step forward in case sensitivity reporting, enhancing the functionality and interoperability of Linux file servers in diverse computing environments.

Winsage
Linux 7.2 To Better Communicate File-System Casefolding For Helping Windows NFS & More