Re: LInux NFSv4.1 client and server- case insensitive filesystems supported?

Chuck Lever
2025-06-07T18:30:43Z

On 6/4/25 2:52 PM, Cedric Blancher wrote:
> On Wed, 4 Jun 2025 at 19:58, Cedric Blancher <cedric.blancher@gmail.com> wrote:
>>
>> Good evening!
>>
>> Does the Linux NFSv4.1 client and server support case insensitive
>> filesystems, e.g. exported FAT or NTFS?
>
> Just found this in Linux kernel fs/nfsd/nfs4xdr.
>
> if (bmval0 & FATTR4_WORD0_CASE_INSENSITIVE) {
> p = xdr_reserve_space(xdr, 4);
> if (!p)
> goto out_resource;
> *p++ = cpu_to_be32(0);
> }
> if (bmval0 & FATTR4_WORD0_CASE_PRESERVING) {
> p = xdr_reserve_space(xdr, 4);
> if (!p)
> goto out_resource;
> *p++ = cpu_to_be32(1);
> }
>
> How did this pass code review, ever?

Hi Cedric-

I presume what you are complaining about is that when these attributes
are queried, NFSD returns fixed values rather than interrogating the
file system on which the target object resides.

Until very recently, the Linux dentry cache supported only case-
sensitive file name lookups, and all of the file systems that NFSD is
regularly tested with are case-preserving.

In that light, this code is entirely justified, and reflects very
similar existing behavior for NFSD's implementation of NFSv3 PATHCONF
(see nfsd3_proc_pathconf). Historically, on Linux, there is only one
possible correct answer for these settings.

My impression is that real case-insensitivity has been added to the
dentry cache in support of FAT on Android devices (or something like
that). That clears the path a bit for NFSD, but it needs to be
researched to see if that new support is adequate for NFS to use.

Recently, Roland poked me about NFSD support for case insensitivity.
Unfortunately that is not a simple topic. There are probably one or two
people on the mailing lists Cc'd here who can explore this with you so
we can understand exactly what behavior folks are looking for, and
determine whether it is feasible to support it in NFSD. Please keep the
discussion public because I'm sure there are multiple interested
parties and even more opinions.

--
Chuck Lever