Re: [BUG] Is casefold unreported in /proc/mounts?

From: Gabriel Krisman Bertazi

Date: Sun Sep 27 2026 - 03:03:04 EST


Daniel Tang <danielzgtg.opensource@xxxxxxxxx> writes:

> Upon successfully mounting via `sudo mount -t tmpfs -o casefold test /mnt`, I
> cannot find a read-only way to determine whether this option is enabled.
> `mount`, `cat /proc/mounts`, and `cat /proc/mountinfo` only display "rw",
> "relatime", and "inode64", never "casefold" for both with and without
> `-o casefold`. The only way on 7.0.0-34-generic to test I found is
> `mkdir test ; chattr +F test ; echo $?`, but that isn't atomic. Which command
> can determine, without writing anything, whether someone or some program
> specified `-o casefold`? If absent, I suggest adding the missing info to
> `/proc/mounts`, likely `mm/shmem.c:shmem_show_options`.

Yeah. For device-backed filesystems it is not a mount parameter, but it
is for shmem/ovl and should show in /proc/mounts.

Either way, there are two ways to check:

1) Parse dmesg after the mount. It is easily overwritten and probably
worse than just trying;

2) better way: do FS_IOC_SETFLAGS on the mountpoint (with chattr
+F). If casefold is supported, you'll get -ENOTEMPTY, otherwise you get
-EOPNOTSUPP. Since it is the root of the filesystem and a single
syscall, unless its remounted from under you (in which case /proc/mounts
doesn't help either), you are safe.

It is worth mentioning you can check kernel support with
/sys/fs/*/features/casefold. We probably should add the same for
/sys/fs/ext4/<disk>/.

This fixes /proc/mounts for shmem: