All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: Gabriel Krisman Bertazi <krisman@suse.de>,
	Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
	"Theodore Ts'o" <tytso@mit.edu>, Hugh Dickins <hughd@google.com>,
	Daniel Tang <danielzgtg.opensource@gmail.com>,
	linux-ext4@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>,
	Amir Goldstein <amir73il@gmail.com>,
	linux-unionfs@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 0/4] Expose encoding information of volumes
Date: Mon, 28 Sep 2026 17:31:51 -0400	[thread overview]
Message-ID: <20260928213155.2612039-1-krisman@suse.de> (raw)

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 <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Hugh Dickins <hughd@google.com>
Cc: Daniel Tang <danielzgtg.opensource@gmail.com>
Cc: linux-ext4@vger.kernel.org
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Amir Goldstein <amir73il@gmail.com>
CC: linux-unionfs@vger.kernel.org
CC: linux-mm@kvack.org

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

-- 
2.55.0


             reply	other threads:[~2026-09-28 21:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 21:31 Gabriel Krisman Bertazi [this message]
2026-09-28 21:31 ` [PATCH 1/4] shmem: Report casefold setting in mount options Gabriel Krisman Bertazi
2026-09-28 21:39   ` sashiko-bot
2026-09-29 14:00   ` Mohammed EL Kadiri
2026-09-29 15:17     ` Gabriel Krisman Bertazi
2026-09-28 21:31 ` [PATCH 2/4] ext4: Expose the filesystem encoding through sysfs Gabriel Krisman Bertazi
2026-09-28 21:45   ` sashiko-bot
2026-09-29  0:18     ` Gabriel Krisman Bertazi
2026-09-28 21:31 ` [PATCH 3/4] ovl: Add /sys/fs/overlay plumbing Gabriel Krisman Bertazi
2026-09-28 21:38   ` sashiko-bot
2026-09-28 21:31 ` [PATCH 4/4] ovl: Expose the filesystem encoding through sysfs Gabriel Krisman Bertazi
2026-09-28 21:37   ` sashiko-bot
2026-09-29 14:15   ` Amir Goldstein
2026-09-29 14:40     ` Pali Rohár
2026-09-29 15:35       ` Gabriel Krisman Bertazi
2026-09-29 15:35     ` Gabriel Krisman Bertazi

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=20260928213155.2612039-1-krisman@suse.de \
    --to=krisman@suse.de \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=danielzgtg.opensource@gmail.com \
    --cc=hughd@google.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.