public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Chuck Lever" <cel@kernel.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: "Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Christian Brauner" <brauner@kernel.org>,
	"Jan Kara" <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
	linux-xfs@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-nfs@vger.kernel.org, linux-api@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	"OGAWA Hirofumi" <hirofumi@mail.parknet.co.jp>,
	"Namjae Jeon" <linkinjeon@kernel.org>,
	"Sungjong Seo" <sj1557.seo@samsung.com>,
	"Yuezhang Mo" <yuezhang.mo@sony.com>,
	almaz.alexandrovich@paragon-software.com,
	"Viacheslav Dubeyko" <slava@dubeyko.com>,
	"John Paul Adrian Glaubitz" <glaubitz@physik.fu-berlin.de>,
	frank.li@vivo.com, "Theodore Tso" <tytso@mit.edu>,
	adilger.kernel@dilger.ca, "Carlos Maiolino" <cem@kernel.org>,
	"Steve French" <sfrench@samba.org>,
	"Paulo Alcantara" <pc@manguebit.org>,
	"Ronnie Sahlberg" <ronniesahlberg@gmail.com>,
	"Shyam Prasad N" <sprasad@microsoft.com>,
	"Trond Myklebust" <trondmy@kernel.org>,
	"Anna Schumaker" <anna@kernel.org>,
	"Jaegeuk Kim" <jaegeuk@kernel.org>, "Chao Yu" <chao@kernel.org>,
	"Hans de Goede" <hansg@kernel.org>,
	senozhatsky@chromium.org, "Chuck Lever" <chuck.lever@oracle.com>,
	"Roland Mainz" <roland.mainz@nrubsig.org>
Subject: Re: [PATCH v11 08/15] xfs: Report case sensitivity in fileattr_get
Date: Mon, 27 Apr 2026 21:32:03 -0400	[thread overview]
Message-ID: <3fd6dcbf-ece6-459e-b114-1d8b95035acf@app.fastmail.com> (raw)
In-Reply-To: <20260427155636.GC7751@frogsfrogsfrogs>



On Mon, Apr 27, 2026, at 11:56 AM, Darrick J. Wong wrote:
> On Fri, Apr 24, 2026 at 09:53:10PM -0400, Chuck Lever wrote:
>> From: Chuck Lever <chuck.lever@oracle.com>
>> 
>> Upper layers such as NFSD need to query whether a filesystem
>> is case-sensitive. Add FS_XFLAG_CASEFOLD to xfs_ip2xflags()
>> when the filesystem is formatted with the ASCIICI feature
>> flag. This serves both FS_IOC_FSGETXATTR (via xfs_fill_fsxattr() in
>> xfs_fileattr_get()) and XFS_IOC_BULKSTAT (which populates bs_xflags
>> directly from xfs_ip2xflags()), so bulkstat consumers and per-inode
>> queries see a consistent view of the filesystem's case-folding
>> behavior.
>> 
>> XFS always preserves case. XFS is case-sensitive by default, but
>> supports ASCII case-insensitive lookups when formatted with the
>> ASCIICI feature flag.
>> 
>> Reviewed-by: Roland Mainz <roland.mainz@nrubsig.org>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---

> I don't understand this at all.  Yes, FS_XFLAG_CASEFOLD is readonly,
> but how does clearing FS_CASEFOLD_FL from the fileattr_get output
> (without clearing XFLAG_CASEFOLD!) solve anything?  This makes the
> reported output inconsistent between fsgetxattr and getflags -- one
> reports case folding, the other reports no casefolding.

The masking is a misplaced reaction to a sashiko review on the
v9 predecessor of this patch [1], which pointed out that v9 set
FS_XFLAG_CASEFOLD in fa->fsx_xflags after xfs_fill_fsxattr() had
already synced fa->flags, leaving the two views inconsistent in
the other direction, and that bulkstat would miss the flag for
the same reason. Moving the injection into xfs_ip2xflags() fixed
both gaps -- but it also surfaced FS_CASEFOLD_FL on the legacy
view, so chattr's RMW through FS_IOC_SETFLAGS hits the EOPNOTSUPP
gate at the top of xfs_fileattr_set(). Hiding it from getflags
was the wrong place to address that.

> If you want to avoid fileattr_set returning EINVAL when setting
> attributes due to the casefold flag, then don't you want to check
> the flag state vs. xfs_has_asciici() in the *fileattr_set* path?

Yep. For v12 I’ll drop the fa->flags mask and add FS_CASEFOLD_FL
to the allowlist in xfs_fileattr_set(), gated on xfs_has_asciici(mp).
xfs_flags2diflags() already has no clause for CASEFOLD, so the
FSSETXATTR path silently no-ops it the same way it does for
FS_XFLAG_HASATTR, and FS_XFLAG_CASEFOLD is in FS_XFLAG_RDONLY_MASK
so FSSETXATTR strips it centrally. Both views then agree, and a
chattr round-trip is accepted as a no-op.

The hfsplus patch in this series carries the same pattern --
FS_XFLAG_CASEFOLD is set after fileattr_fill_flags() so that
FS_CASEFOLD_FL stays out of fa->flags and dodges the EOPNOTSUPP
gate in hfsplus_fileattr_set(). I will fix it the same way.

Thanks for the catch!

[1] https://sashiko.dev/#/patchset/20260422-case-sensitivity-v9-0-be023cc070e2@oracle.com?part=9


-- 
Chuck Lever

  reply	other threads:[~2026-04-28  1:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25  1:53 [PATCH v11 00/15] Exposing case folding behavior Chuck Lever
2026-04-25  1:53 ` [PATCH v11 01/15] fs: Move file_kattr initialization to callers Chuck Lever
2026-04-25  1:53 ` [PATCH v11 02/15] fs: Add case sensitivity flags to file_kattr Chuck Lever
2026-04-25  1:53 ` [PATCH v11 03/15] fat: Implement fileattr_get for case sensitivity Chuck Lever
2026-04-25  1:53 ` [PATCH v11 04/15] exfat: " Chuck Lever
2026-04-25  1:53 ` [PATCH v11 05/15] ntfs3: " Chuck Lever
2026-04-25  1:53 ` [PATCH v11 06/15] hfs: " Chuck Lever
2026-04-25  1:53 ` [PATCH v11 07/15] hfsplus: Report case sensitivity in fileattr_get Chuck Lever
2026-04-25  1:53 ` [PATCH v11 08/15] xfs: " Chuck Lever
2026-04-27 15:56   ` Darrick J. Wong
2026-04-28  1:32     ` Chuck Lever [this message]
2026-04-25  1:53 ` [PATCH v11 09/15] cifs: Implement fileattr_get for case sensitivity Chuck Lever
2026-04-25  1:53 ` [PATCH v11 10/15] nfs: " Chuck Lever
2026-04-25  1:53 ` [PATCH v11 11/15] vboxsf: " Chuck Lever
2026-04-25  1:53 ` [PATCH v11 12/15] isofs: " Chuck Lever
2026-04-27 10:44   ` Jan Kara
2026-04-27 12:02     ` Lionel Cons
2026-04-27 13:30       ` Jan Kara
2026-04-25  1:53 ` [PATCH v11 13/15] nfsd: Report export case-folding via NFSv3 PATHCONF Chuck Lever
2026-04-25  1:53 ` [PATCH v11 14/15] nfsd: Implement NFSv4 FATTR4_CASE_INSENSITIVE and FATTR4_CASE_PRESERVING Chuck Lever
2026-04-25  1:53 ` [PATCH v11 15/15] ksmbd: Report filesystem case sensitivity via FS_ATTRIBUTE_INFORMATION Chuck Lever
2026-04-27 10:55 ` [PATCH v11 00/15] Exposing case folding behavior Jan Kara
2026-04-27 13:30   ` Chuck Lever
2026-04-27 15:30     ` Jan Kara

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=3fd6dcbf-ece6-459e-b114-1d8b95035acf@app.fastmail.com \
    --to=cel@kernel.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=anna@kernel.org \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=chao@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=djwong@kernel.org \
    --cc=frank.li@vivo.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=hansg@kernel.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=jack@suse.cz \
    --cc=jaegeuk@kernel.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=pc@manguebit.org \
    --cc=roland.mainz@nrubsig.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=senozhatsky@chromium.org \
    --cc=sfrench@samba.org \
    --cc=sj1557.seo@samsung.com \
    --cc=slava@dubeyko.com \
    --cc=sprasad@microsoft.com \
    --cc=trondmy@kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yuezhang.mo@sony.com \
    /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