Skip to content

Expose encoding information of volumes

Gabriel Krisman Bertazi linux-ext4 linux-fsdevel linux-mm linux-unionfs sashiko-reviews 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4shmem: Report casefold setting in mount optionsmm/shmem.c+11 -02 replies
2/4ext4: Expose the filesystem encoding through sysfsDocumentation/ABI/testing/sysfs-fs-ext4 fs/ext4/sysfs.c+50 -01 reply
3/4ovl: Add /sys/fs/overlay plumbingDocumentation/ABI/testing/sysfs-fs-overlay MAINTAINERS fs/overlayfs/Makefile +4 more+144 -40 replies
4/4ovl: Expose the filesystem encoding through sysfsDocumentation/ABI/testing/sysfs-fs-overlay fs/overlayfs/sysfs.c+22 -04 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by.

PatchMohammed EL Kadiri
1/4T-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] Expose encoding information of volumes

Daniel Tang reported [1] some inconsistencies in detecting filesystem casefold support on shmem. The problem is that we don't expose the casefold arguments in /proc/mounts for shmem, requiring you to probe the the filesystem to discover it. More interestingly, it can be a problem for programs that use /proc/mounts to remount filesystems, making them to remount "case-sensitively'. This apparently is a real use case in linux utils, according to my favorite LLM. shmem is fixed by patch 1.

This made me go look at how other casefolding filesystems expose this information and found it to be very inconsistent. f2fs is the only one doing it properly over /sys/fs/<vol>/encoding. Ext4 and ovl don't have nice ways to expose it, so the remaining patches replicate the f2fs interface for them.

I considered a /sys/fs interface for shmem as wel. It makes sense. But since shmem is the only filesystem where casefolding is a mount option, it also makes sense for it to appear in /proc/mounts. Considering it doesn't have /sys/fs at the moment, it does fell like overkill to add it just for this file.

ovl also doesn't have a /sys/fs/ entry. But in its case, casefold is derived from the lower/upper directories, so it cannot not be set in /proc/mounts. For this reason, I ended up plumbling /sys/fs/overlay and wiring the encoding file just like ext4 and f2fs.

[1] https://lore.kernel.org/linux-fsdevel/5193732.31r3eYUQgx@daniel-desktop3/#

---
Cc: Christian Brauner <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Daniel Tang <[email protected]>
Cc: [email protected]
Cc: Miklos Szeredi <[email protected]>
Cc: Amir Goldstein <[email protected]>
CC: [email protected]
CC: [email protected]

Gabriel Krisman Bertazi (4):
shmem: Report casefold setting in mount options
ext4: Expose the filesystem encoding through sysfs
ovl: Add /sys/fs/overlay plumbing
ovl: Expose the filesystem encoding through sysfs

 Documentation/ABI/testing/sysfs-fs-ext4    |  21 ++++
 Documentation/ABI/testing/sysfs-fs-overlay |  13 +++
 MAINTAINERS                                |   1 +
 fs/ext4/sysfs.c                            |  29 ++++++
 fs/overlayfs/Makefile                      |   2 +-
 fs/overlayfs/overlayfs.h                   |   5 +
 fs/overlayfs/ovl_entry.h                   |   7 ++
 fs/overlayfs/super.c                       |  26 ++++-
 fs/overlayfs/sysfs.c                       | 116 +++++++++++++++++++++
 mm/shmem.c                                 |  11 ++
 10 files changed, 227 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-fs-overlay
 create mode 100644 fs/overlayfs/sysfs.c
Signature · 1 line
2.55.0