linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matthew Wilcox <willy@infradead.org>,
	lampahome <pahome.chen@mirlab.org>,
	linux-fsdevel@vger.kernel.org
Subject: Re: why do we need utf8 normalization when compare name?
Date: Mon, 2 Mar 2020 13:12:41 -0500	[thread overview]
Message-ID: <20200302181241.GC6826@mit.edu> (raw)
In-Reply-To: <20200302152818.GN23230@ZenIV.linux.org.uk>

On Mon, Mar 02, 2020 at 03:28:18PM +0000, Al Viro wrote:
> Why the hell do we need case-insensitive filesystems in the first place?
> I have only heard two explanations:
> 	1) because the layout (including name equivalences) is fixed by
> some OS that happens to be authoritative for that filesystem.  In that
> case we need to match the rules of that OS, whatever they are.  Unicode
> equivalence may be an interesting part of _their_ background reasons
> for setting those rules, but the only thing that really matters is what
> rules have they set.

It significantly helps porting applications that were originally
written for Windows and/or MacOS.  In particular, the work to add
Unicode comparison support to ext4 was funded to enable the ability to
run Windows gaming applications on Linux for Steam.


> 	2) early Android used to include a memory card with VFAT on
> it; the card is long gone, but crapplications came to rely upon having
> that shit.  And rather than giving them a file on the normal filesystem
> with VFAT image on it and /dev/loop set up and mounted, somebody wants
> to use parts of the normal (ext4) filesystem for it.  However, the
> same crapplications have come to rely upon the case-insensitive (sensu
> VFAT) behaviour there, so we must duplicate that vomit-inducing pile
> of hacks on ext4.  Ideally - with that vomit-induc{ing,ed} pile
> reclassified as a generic feature; those look more respectable.

There are a number of reasons why a loop device is not sufficient;
there is a requirement to have selective sharing of application data
between other applications, which is done using user/group ownership.

For Android, previously, this was done using sdcardfs which was based
off of wrapfs.  Wrapfs was the same base as unionfs, and as you may
recall, it had even more horrendous race issues, and more than once I
was asked to help to debug crashes when you fsstress was run on
different views of sdcardfs.  I've been strongly encouraging the push
to something more sane, but a requirement for this is case-folded
directory.

There is a third reason why case folding is necessary, which is for
file serving applications such as Samba which require case-folding,
and without file system level support, trying to simulate this in
userspace requires searching via readdir to do a case-insensitive
lookup (at least in some case).  So finding a more performant way to
support case-folding is a big help for applications like Samba.

Cheers,

						- Ted

      parent reply	other threads:[~2020-03-02 18:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02  9:00 why do we need utf8 normalization when compare name? lampahome
2020-03-02 10:37 ` Aleksa Sarai
2020-03-02 10:47   ` Aleksa Sarai
2020-03-03  1:48     ` lampahome
     [not found]       ` <20200303070928.aawxoyeq77wnc3ts@yavin>
2020-03-03 10:13         ` lampahome
2020-03-03 17:22           ` Theodore Y. Ts'o
2020-03-02 12:54 ` Matthew Wilcox
2020-03-02 15:28   ` Al Viro
2020-03-02 17:14     ` Matthew Wilcox
2020-03-02 18:12     ` Theodore Y. Ts'o [this message]

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=20200302181241.GC6826@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pahome.chen@mirlab.org \
    --cc=viro@zeniv.linux.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).