Re: [v4 0/3] bcachefs: Casefolding implementation

Kent Overstreet
2023-08-16T19:41:16Z

On Mon, Aug 14, 2023 at 02:24:24AM +0100, Joshua Ashton wrote:
> This implements support for case-insensitive file and directory
> lookups using the regular `chattr +F` (`S_CASEFOLD`, `FS_CASEFOLD_FL`)
> casefolding attributes for bcachefs.
>
> The implementation uses the same UTF-8 lowering and normalization that
> ext4 and f2fs is using currently
>
> The main usecase for casefolding is compatibility with software written
> against other filesystems that rely on casefolded lookups
> (eg. NTFS and Wine/Proton).
> Taking advantage of file-system level casefolding can lead to great
> loading time gains in many applications and games.
>
> See more information and rationale in:
> Documentation/filesystems/bcachefs/casefolding.rst
>
> You can see/review the work in my tree here:
> https://github.com/Joshua-Ashton/bcachefs/tree/casefold
>
> v2: Update format to store length in dirent based on flag, add comments, cleanup
> dirent_create_key, other misc. nits from IRC.
>
> v3: Cleanup the dirent code, utilize the fact that BCH_NAME_MAX is smaller now,
> remove fallbacks for too big keys that won't make sense anymore. Improved
> lookup string lowering.
>
> v4: Move cf_name allocation from stack to trans alloc, validated bkey in invalid,
> used length directly, misc. nits.

Josh, do you think you could post the benchmarks you ran at the start of
all this? We should look at those again after negative dentries are
hooked up and working correctly.

After giving this more thought, I'm starting to feel a bit more inclined
to Gabriel's approach...