The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Matthew Wilcox <willy@infradead.org>,
	Theodore Ts'o <tytso@mit.edu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-bcachefs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] bcachefs fixes for 6.15-rc4
Date: Sun, 27 Apr 2025 19:15:14 -0700	[thread overview]
Message-ID: <20250428021514.GB6134@sol.localdomain> (raw)
In-Reply-To: <ytjddsxe5uy4swchkn2hh56lwqegv6hinmlmipq3xxinqzkjnd@cpdw4thi3fqq>

On Sun, Apr 27, 2025 at 09:43:43PM -0400, Kent Overstreet wrote:
> On Sun, Apr 27, 2025 at 06:30:59PM -0700, Eric Biggers wrote:
> > On Sun, Apr 27, 2025 at 08:55:30PM -0400, Kent Overstreet wrote:
> > > The thing is, that's exactly what we're doing. ext4 and bcachefs both
> > > refer to a specific revision of the folding rules: for ext4 it's
> > > specified in the superblock, for bcachefs it's hardcoded for the moment.
> > > 
> > > I don't think this is the ideal approach, though.
> > > 
> > > That means the folding rules are "whatever you got when you mkfs'd".
> > > Think about what that means if you've got a fleet of machines, of
> > > different ages, but all updated in sync: that's a really annoying way
> > > for gremlins of the "why does this machine act differently" variety to
> > > creep in.
> > > 
> > > What I'd prefer is for the unicode folding rules to be transparently and
> > > automatically updated when the kernel is updated, so that behaviour
> > > stays in sync. That would behave more the way users would expect.
> > > 
> > > But I only gave this real thought just over the past few days, and doing
> > > this safely and correctly would require some fairly significant changes
> > > to the way casefolding works.
> > > 
> > > We'd have to ensure that lookups via the case sensitive name always
> > > works, even if the casefolding table the dirent was created with give
> > > different results that the currently active casefolding table.
> > > 
> > > That would require storing two different "dirents" for each real dirent,
> > > one normalized and one un-normalized, because we'd have to do an
> > > un-normalized lookup if the normalized lookup fails (and vice versa).
> > > Which should be completely fine from a performance POV, assuming we have
> > > working negative dentries.
> > > 
> > > But, if the unicode folding rules are stable enough (and one would hope
> > > they are), hopefully all this is a non-issue.
> > > 
> > > I'd have to gather more input from users of casefolding on other
> > > filesystems before saying what our long term plans (if any) will be.
> > 
> > Wouldn't lookups via the case-sensitive name keep working even if the
> > case-insensitivity rules change?  It's lookups via a case-insensitive name that
> > could start producing different results.  Applications can depend on
> > case-insensitive lookups being done in a certain way, so changing the
> > case-insensitivity rules can be risky.
> 
> No, because right now on a case-insensitive filesystem we _only_ do the
> lookup with the normalized name.

Well, changing the case-insensitivity rules on an existing filesystem breaks the
directory indexing, so when the filesystem does an indexed lookup in a directory
it might no longer look in the right place.  But if the dentry were to be
examined regardless, it would still match.  (Again, assuming that the lookup
uses a name that is case-sensitively the same as the name the file was created
with.  If it's not case-sensitively the same, that's another story.)  ext4 and
f2fs recently added a fallback to a linear search for dentries in "casefolded"
directories, which handle this by no longer relying solely on the directory
indexing.  See commits 9e28059d56649 and 91b587ba79e1b.

- Eric

  parent reply	other threads:[~2025-04-28  2:15 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25  2:46 [GIT PULL] bcachefs fixes for 6.15-rc4 Kent Overstreet
2025-04-25  4:20 ` Linus Torvalds
2025-04-25  4:51   ` Kent Overstreet
2025-04-25  5:23     ` Kent Overstreet
2025-04-25 16:35     ` Linus Torvalds
2025-04-25 19:40       ` Matthew Wilcox
2025-04-25 20:35         ` Linus Torvalds
2025-04-28  0:55         ` Kent Overstreet
2025-04-28  1:30           ` Eric Biggers
2025-04-28  1:43             ` Kent Overstreet
2025-04-28  2:05               ` Autumn Ashton
2025-04-28  2:16                 ` Kent Overstreet
2025-04-28  2:56                   ` Autumn Ashton
2025-04-28  2:22                 ` Eric Biggers
2025-04-28  2:34                   ` Kent Overstreet
2025-04-28  2:53                     ` Linus Torvalds
2025-04-28  3:22                       ` Kent Overstreet
2025-04-28  2:39                   ` Linus Torvalds
2025-04-28  3:01                     ` Kent Overstreet
2025-04-28  3:13                       ` Eric Biggers
2025-04-28  3:16                       ` Linus Torvalds
2025-04-28  2:15               ` Eric Biggers [this message]
2025-04-28  2:33                 ` Kent Overstreet
2025-04-28  2:49                   ` Eric Biggers
2025-04-28  3:29                     ` Kent Overstreet
2025-04-25 19:59       ` Theodore Ts'o
2025-05-01  2:48         ` H. Peter Anvin
2025-05-01  3:11           ` Kent Overstreet
2025-05-01  3:12           ` Linus Torvalds
2025-05-01  3:32             ` H. Peter Anvin
2025-05-01  4:55               ` Carl E. Thompson
2025-05-01  4:51             ` H. Peter Anvin
2025-04-26  1:38       ` Kent Overstreet
2025-04-26  2:47         ` Linus Torvalds
2025-04-26  3:00           ` Kent Overstreet
2025-04-26  3:04             ` Linus Torvalds
2025-04-26  3:09               ` Kent Overstreet
2025-04-26  3:40                 ` Linus Torvalds
2025-04-26  3:59                   ` Kent Overstreet
2025-04-26  4:11                     ` Linus Torvalds
2025-04-26  4:49                       ` Kent Overstreet
2025-04-26  5:01                         ` Linus Torvalds
2025-04-26  5:18                           ` Kent Overstreet
2025-04-29 15:36                   ` Patrick Donnelly
2025-04-29 16:21                     ` Kent Overstreet
2025-04-29 16:48                       ` Patrick Donnelly
2025-04-25 18:01 ` pr-tracker-bot

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=20250428021514.GB6134@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=willy@infradead.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