public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Cedric Blancher <cedric.blancher@gmail.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: LInux NFSv4.1 client and server- case insensitive filesystems supported?
Date: Sat, 7 Jun 2025 22:39:51 +0000	[thread overview]
Message-ID: <20250607223951.GB784455@mit.edu> (raw)
In-Reply-To: <44250631-2b70-4ce8-b513-a632e70704ed@oracle.com>

On Sat, Jun 07, 2025 at 02:30:37PM -0400, Chuck Lever wrote:
> 
> 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.

Case insensitivty was added in Linux in 2019, with the primary coding
work being done by Gabriel Krisman Bertazi of Collabora, and design
work being done being done by Gabriel, Michael Halcrow, and myself.
(Michael Halcrow in particular was responsible for devising how to
make case-insensitivity work with filename encryption and indexed
directories.)

The initial file systems that had case-insensitivty implemented was
ext4 and f2fs.  The initial use cases was Android devices (which had
used this horible wrapfs stacking file system thing which was trivial
to deadlock under stress, and its original reason for existing was
bug-for-bug compatibility with FAT), and for Steam so that Windows
games could have their expected case insensitivity.  (Collabora's work
was underwritten by Steam.)

There is an interesting write-up about NFS and case-insensitivity in a
relatively recent Internet-Draft[1], dated 2025-May-16.  In this I-D,
it points out that one of the primary concerns is that if the client
caches negative lookups under one case (say, MaDNeSS), and then the
file is created using a different case (say "madness"), then the
negative dentry cache indicating that MaDNeSS does not exist needs to
be removed when "madness" is created.  I'm not sure how Linux's NFS
client handles negative dentries, since even without
case-insensitivity, a file name that previously didn't exist could
have subsequently been created by another client on a different host.
So does Linux's NFS client simply does not use negative dentries, or
does it have some kind of cache invalidation scheme when the directory
has a new mtime, or some such?

[1] https://www.ietf.org/id/draft-ietf-nfsv4-internationalization-12.html#name-handling-of-string-equivale

Anyway, case sensitivity is one of those "interesting" problems which
has caused many headaches, including a potential security issue, and a
botched attempt to fix that security issue interacting poorly with
some of the more subtle design requirements so that file systems can
use tree-indexed directory lookups, even with case-insensitivty file
names and encrypted directory entries.  So in general, unless you have
strong financial backing where someone is willing to pay $$$ to
address a business-critical use case, my personal advice is to stay
far, far, away.  And I say this as a someone (with apologies to Linus)
who was partially responsible for Linux having case insensitivty
lookups in the first place.  :-)

Cheers,

						- Ted

  reply	other threads:[~2025-06-07 22:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04 17:58 LInux NFSv4.1 client and server- case insensitive filesystems supported? Cedric Blancher
2025-06-04 18:52 ` Cedric Blancher
2025-06-07 18:30   ` Chuck Lever
2025-06-07 22:39     ` Theodore Ts'o [this message]
2025-06-08 10:19       ` Jeff Layton
2025-06-08 16:29       ` Chuck Lever
2025-06-08 20:52         ` Theodore Ts'o
2025-06-08 21:52           ` Chuck Lever
2025-06-09 15:28             ` Gabriel Krisman Bertazi
2025-06-09 15:50             ` Theodore Ts'o
2025-06-09 16:41               ` Chuck Lever
2025-06-09  5:57     ` Christoph Hellwig
2025-06-09 14:16       ` Chuck Lever
2025-06-10  5:34         ` Christoph Hellwig
2025-09-09 16:06           ` NFSv4.x export options to mark export as case-insensitive, case-preserving? " Cedric Blancher
2025-09-09 16:11             ` Cedric Blancher
2025-09-09 16:11             ` Chuck Lever
2025-09-09 16:33               ` Cedric Blancher
2025-09-09 19:32                 ` Chuck Lever
2025-09-10 10:44                   ` Roland Mainz
2025-09-10 13:37                     ` Rick Macklem
2025-09-11  8:07                       ` fattr4_archive "deprecated" ? " Cedric Blancher
2025-09-11 15:01                         ` Rick Macklem
2025-09-11 15:26                           ` Trond Myklebust
2025-09-11 15:33                             ` Cedric Blancher
2025-09-11 15:36                               ` Cedric Blancher
2025-09-11 16:08                                 ` Cedric Blancher
2025-09-10 11:10             ` Jeff Layton
2025-09-10 14:14               ` Chuck Lever
2025-09-10 14:30                 ` Jeff Layton
2025-09-10 14:35                   ` Chuck Lever
2025-09-11  6:52                     ` Cedric Blancher
2025-09-11  6:49               ` Cedric Blancher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250607223951.GB784455@mit.edu \
    --to=tytso@mit.edu \
    --cc=cedric.blancher@gmail.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox