Re: [PATCH v11 00/15] Exposing case folding behavior
From: "Chuck Lever" <cel@kernel.org>
Date: 2026-04-27 13:30:50
Also in:
linux-cifs, linux-ext4, linux-f2fs-devel, linux-fsdevel, linux-nfs, linux-xfs
On Mon, Apr 27, 2026, at 6:55 AM, Jan Kara wrote:
On Fri 24-04-26 21:53:02, Chuck Lever wrote:quoted
Changes since v10: - cifs: Source case-handling flags from the server's cached FS_ATTRIBUTE_INFORMATION reply instead of the nocase mount option, with a nocase fallback when the reply is absent - Address findings from sashiko(gemini-3) and gpt-5.5: - nfs: Skip pathconf case bits on NFSv4 (set via FATTR4_CASE_* instead) - xfs: Hide FS_CASEFOLD_FL from the legacy flags view so chattr round-trips do not hit the setflags whitelist - ext4, f2fs: Drop redundant fileattr_get patches; the FS_CASEFOLD_FL translation in fileattr_fill_flags() already reports FS_XFLAG_CASEFOLD for casefolded directoriesErr, how is this supposed to work? I wasn't able to find any code transforming S_CASEFOLDED inode flag into FS_CASEFOLD_FL on fileattr_get path. Sure, fileattr_fill_flags() takes care of setting FS_XFLAG_CASEFOLD once FS_CASEFOLD_FL is set. What am I missing?
Agreed, that is a little surprising.
The path does not go through S_CASEFOLD. Both filesystems
report FS_CASEFOLD_FL straight from their on-disk flag word.
For ext4, EXT4_CASEFOLD_FL is 0x40000000, the same bit value
as FS_CASEFOLD_FL, and it is included in EXT4_FL_USER_VISIBLE.
ext4_iget() loads it into ei->i_flags directly from
raw_inode->i_flags (fs/ext4/inode.c:5358). ext4_fileattr_get()
then masks with EXT4_FL_USER_VISIBLE and hands the result to
fileattr_fill_flags(), which translates FS_CASEFOLD_FL into
FS_XFLAG_CASEFOLD on the way out.
For f2fs, f2fs_fileattr_get() runs fi->i_flags through
f2fs_iflags_to_fsflags(), whose mapping table has an explicit
{ F2FS_CASEFOLD_FL, FS_CASEFOLD_FL } entry (fs/f2fs/file.c:2205).
F2FS_GETTABLE_FS_FL includes FS_CASEFOLD_FL, so
fileattr_fill_flags() again lights up FS_XFLAG_CASEFOLD.
S_CASEFOLD is a separate VFS-level cache that
ext4_set_inode_flags() and f2fs's equivalent set at iget
time; nothing on the fileattr_get path consults it.
For reference, the original observation about the manual
assignment being redundant came from sashiko's review of v10:
https://sashiko.dev/#/patchset/20260423-case-sensitivity-v10-0-c385d674a6cf%40oracle.com?part=8
https://sashiko.dev/#/patchset/20260423-case-sensitivity-v10-0-c385d674a6cf%40oracle.com?part=12
--
Chuck Lever