Re: [PATCH 1/3] libfs: reject casefolded names that fold to ".", "..", or empty

From: Theodore Tso

Date: Tue Nov 17 2026 - 09:55:22 EST


On Tue, Nov 17, 2026 at 08:47:27AM -0500, David Laight wrote:
> > Sigh... I really think these characters are *evil*. I wonder if we
> > should simply drop those code points unconditionally when they are fed
> > to the kernel --- not only folding to themselves, but *not* preserving
> > them when a misguided application tries to create a file with one of
> > these misbegotten Unicode charactesr.
>
> Doesn't that assume that filenames are UTF8 rather than just sequences
> of bytes with everything except '\0' and '/' being valid.
> Casefolding is itself so evil/impossible it shouldn't have been allowed.

We would only do this if casefolding is enabled. For better or for
worse, it's better than what it replaced which was this terrible
wrapfs hack that was a trivial to trigger deadlocks using fsstress ---
which was even more evil.

The other way we can deal with this is that if case folding is
enabled, we change the VFS to call the case-folding for incoming
filename *before* it does its special case checking for '.' and '..'
if casefolding is enabled.

- Ted