From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Mohammed EL Kadiri <med08elkadiri@gmail.com>
Cc: amir73il@gmail.com, brauner@kernel.org,
danielzgtg.opensource@gmail.com, hughd@google.com, jack@suse.cz,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-unionfs@vger.kernel.org,
miklos@szeredi.hu, tytso@mit.edu
Subject: Re: [PATCH 1/4] shmem: Report casefold setting in mount options
Date: Tue, 29 Sep 2026 11:17:48 -0400 [thread overview]
Message-ID: <87pkxwxf1f.fsf@mailhost.krisman.be> (raw)
In-Reply-To: <20260929140011.211148-1-med08elkadiri@gmail.com>
Mohammed EL Kadiri <med08elkadiri@gmail.com> writes:
> On Mon, Sep 28, 2026 at 05:31:52PM -0400, Gabriel Krisman Bertazi wrote:
>> For shmem, casefolding is a mount option. Report the current encoding
>> and casefolding flags in /proc/mounts
>
> This works for me, on 90ddfbd19636 (akpm/mm-unstable), x86_64,
> CONFIG_UNICODE=y:
>
> # mount -t tmpfs -o casefold tmpfs /t
> # grep /t /proc/mounts
> tmpfs /t tmpfs rw,relatime,casefold=utf8-12.1.0 0 0
>
> Tested-by: Mohammed EL Kadiri <med08elkadiri@gmail.com>
Thanks!
>
> Heads-up on one side effect, since mount(8) builds its remount options
> from /proc/mounts: once casefold= is listed there, it gets passed back on
> every remount.
>
> # mount -t tmpfs -o casefold tmpfs /t
> [ 527.593309] tmpfs: Using encoding : utf8-12.1.0
> # mount -o remount,size=64M /t
> [ 527.595716] tmpfs: Using encoding : utf8-12.1.0
This is desired behavior, IMO. You should not lose casefold during a
remount, at risk of botching your data/splitting unrelated files. Also
this is the reason why I didn't expose it directly in /proc/mounts for
ovl, it would be easier but break the remount.
> That second line is shmem_parse_opt_casefold() running on a remount that
> only asked to change size. It calls utf8_load() each time, and nothing
> frees the result - shmem_reconfigure() doesn't look at ctx->encoding and
> shmem_free_fc() doesn't unload it. 50000 such remounts grew kmalloc-32 by
> ~50000 objects; a tmpfs without casefold stays flat.
>
> The leak predates this patch - you can trigger it by passing casefold= on
> a remount by hand - so I sent the fix as a separate patch:
>
> https://lore.kernel.org/all/ba38f80f629fd093c77f3a49fdab7b71ee7bbc5f.1790687276.git.med08elkadiri@gmail.com/
Thanks for reporting and fixing this. feel free to cc me on further
unicode stuff. Will review it right now.
Thanks,
--
Gabriel Krisman Bertazi
next prev parent reply other threads:[~2026-09-29 15:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 21:31 [PATCH 0/4] Expose encoding information of volumes Gabriel Krisman Bertazi
2026-09-28 21:31 ` [PATCH 1/4] shmem: Report casefold setting in mount options Gabriel Krisman Bertazi
2026-09-29 14:00 ` Mohammed EL Kadiri
2026-09-29 15:17 ` Gabriel Krisman Bertazi [this message]
2026-09-28 21:31 ` [PATCH 2/4] ext4: Expose the filesystem encoding through sysfs Gabriel Krisman Bertazi
2026-09-28 21:31 ` [PATCH 3/4] ovl: Add /sys/fs/overlay plumbing Gabriel Krisman Bertazi
2026-09-28 21:31 ` [PATCH 4/4] ovl: Expose the filesystem encoding through sysfs Gabriel Krisman Bertazi
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=87pkxwxf1f.fsf@mailhost.krisman.be \
--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=med08elkadiri@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox