linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs
@ 2024-08-23 17:33 André Almeida
  2024-08-23 17:33 ` [PATCH 1/5] tmpfs: Add casefold lookup support André Almeida
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: André Almeida @ 2024-08-23 17:33 UTC (permalink / raw)
  To: Hugh Dickins, Andrew Morton, Alexander Viro, Christian Brauner,
	Jan Kara
  Cc: linux-mm, linux-kernel, linux-fsdevel, kernel-dev, krisman,
	Daniel Rosenberg, smcv, André Almeida

Hi,

This series is based on [0].

This patchset adds support for case-insesitive file names lookups in tmpfs. The
main difference from other casefold filesystems is that tmpfs has no information
on disk, just on RAM, so we can't use mkfs to create a case-insensitive tmpfs.
For this implementation, I opted to have a mount option for casefolding. The
rest of the patchset follows a similar approach as ext4 and f2fs.

* Use case (from the original cover letter)

The use case for this feature is similar to the use case for ext4, to
better support compatibility layers (like Wine), particularly in
combination with sandboxing/container tools (like Flatpak). Those
containerization tools can share a subset of the host filesystem with an
application. In the container, the root directory and any parent
directories required for a shared directory are on tmpfs, with the
shared directories bind-mounted into the container's view of the
filesystem.

If the host filesystem is using case-insensitive directories, then the
application can do lookups inside those directories in a
case-insensitive way, without this needing to be implemented in
user-space. However, if the host is only sharing a subset of a
case-insensitive directory with the application, then the parent
directories of the mount point will be part of the container's root
tmpfs. When the application tries to do case-insensitive lookups of
those parent directories on a case-sensitive tmpfs, the lookup will
fail.

For example, if /srv/games is a case-insensitive directory on the host,
then applications will expect /srv/games/Steam/Half-Life and
/srv/games/steam/half-life to be interchangeable; but if the
container framework is only sharing /srv/games/Steam/Half-Life and
/srv/games/Steam/Portal (and not the rest of /srv/games) with the
container, with /srv, /srv/games and /srv/games/Steam as part of the
container's tmpfs root, then making /srv/games a case-insensitive
directory inside the container would be necessary to meet that
expectation.

* Testing

I send a patch for xfstests to enable the casefold test (generic/556) for tmpfs.[1]
The test succeed.

You can test this patchset using:

  sudo mount -t tmpfs -o casefold=utf8-12.1.0 tmpfs mnt/

And making a dir case-insesitive:

  mkdir mnt/dir
  chattr +F mnt/dir

[0] https://lore.kernel.org/linux-fsdevel/20210323195941.69720-1-andrealmeid@collabora.com/
[1] https://lore.kernel.org/fstests/20240823173008.280917-1-andrealmeid@igalia.com/

André Almeida (5):
  tmpfs: Add casefold lookup support
  tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs
  tmpfs: Create casefold mount options
  tmpfs: Expose filesystem features via sysfs
  docs: tmpfs: Add casefold options

 Documentation/filesystems/tmpfs.rst |  37 +++++
 include/linux/shmem_fs.h            |   7 +-
 mm/shmem.c                          | 205 ++++++++++++++++++++++++++--
 3 files changed, 238 insertions(+), 11 deletions(-)

-- 
2.46.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-08-29  9:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 17:33 [PATCH 0/5] tmpfs: Add case-insesitive support for tmpfs André Almeida
2024-08-23 17:33 ` [PATCH 1/5] tmpfs: Add casefold lookup support André Almeida
2024-08-26 19:16   ` Gabriel Krisman Bertazi
2024-08-26 23:40   ` kernel test robot
2024-08-23 17:33 ` [PATCH 2/5] tmpfs: Add flag FS_CASEFOLD_FL support for tmpfs dirs André Almeida
2024-08-23 17:33 ` [PATCH 3/5] tmpfs: Create casefold mount options André Almeida
2024-08-29  9:25   ` Dan Carpenter
2024-08-23 17:33 ` [PATCH 4/5] tmpfs: Expose filesystem features via sysfs André Almeida
2024-08-26 22:58   ` kernel test robot
2024-08-23 17:33 ` [PATCH 5/5] docs: tmpfs: Add casefold options André Almeida

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).