All of lore.kernel.org
 help / color / mirror / Atom feed
From: "koraynilay" <koray.fra@gmail.com>
To: "Amir Goldstein" <amir73il@gmail.com>,
	"koraynilay" <koray.fra@gmail.com>
Cc: "Namjae Jeon" <linkinjeon@kernel.org>,
	"Hyunchul Lee" <hyc.lee@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Eric Biggers" <ebiggers@kernel.org>,
	"Theodore Y . Ts'o" <tytso@mit.edu>,
	"Jaegeuk Kim" <jaegeuk@kernel.org>,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Christian Brauner" <brauner@kernel.org>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Chuck Lever" <cel@kernel.org>,
	"Jeff Layton" <jlayton@kernel.org>, "Jan Kara" <jack@suse.cz>,
	"Alexander Aring" <alex.aring@gmail.com>,
	"Darrick J . Wong" <djwong@kernel.org>,
	"Andrey Albershteyn" <aalbersh@kernel.org>,
	"Miklos Szeredi" <miklos@szeredi.hu>,
	"Pali Rohár" <pali@kernel.org>,
	"Lauri Gates" <lauri.gates@gmail.com>,
	"Christoph Hellwig" <hch@infradead.org>,
	"Dave Chinner" <dgc@kernel.org>,
	linux-btrfs@vger.kernel.org, linux-xfs@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	ntfs@lists.linux.dev, linux-nfs@vger.kernel.org,
	linux-api@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-unionfs@vger.kernel.org
Subject: Re: [PATCH v3 2/5] vfs: add xflags masks to fileattr API
Date: Tue, 01 Dec 2026 00:05:17 +0100	[thread overview]
Message-ID: <DN8X6ZGF78ZH.1OHQO5COG7NC7@gmail.com> (raw)
In-Reply-To: <CAOQ4uxjjRWmUuSVP8fx3H+=QBY_x789eXBg1N8EotJF8_V-dSQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5684 bytes --]

On Mon Nov 30, 2026 at 11:54 PM CET, Amir Goldstein wrote:
> On Mon, Nov 30, 2026 at 10:25 PM koraynilay <koray.fra@gmail.com> wrote:
>>
> ...
>
>> > This is exactly what I was looking for.
>> > PROJID is only singled out in one place (here) when defining the macro
>> > and a comment above the macro explains why.
>> > From this point on the macro describes a trait, which has a very clear
>> > meaning, without mentioning any specific flag.
>> >
>> > Good job, bot ;)
>>
>> Yes, though, when trying to change the current code to use it, I'm not
>> liking the name too much, since it seems like it's a subset of
>> FS_XFLAGS_FSXATTR_MASK, while it's actually not, since
>> FS_XFLAGS_FSXATTR_MASK does not include PROJID.
>>
>
> IDK, you can try _[GS]ET_MASK
> it's a more accurate description.

Right, I'll with that as well.

>> >> Also, could we change FS_XFLAGS_FSXATTR_MASK to FS_XFLAGS_FSXATTR? (and
>> >> so also FS_XFLAGS_FSXATTR_RW)
>> >
>> > This reduces readability considerably IMO.
>> > There needs to be a clear separation between the
>> > flag macros and the flag collection macros (traits if you will).
>>
>> Hmm, fair, I proposed this change because the names are getting a bit
>> long and formatting the code is harder, also they have FLAG*S* that can
>> indicate it's a collection, but that's easily missable (and indeed, I
>> can never remember if it's FS_XFLAG_MASK or FS_XFLAGS_MASK, one more
>> reason removing the _MASK may be beneficial, at least to me lol).
>>
>> >> And I'd also change FS_FILE_ATTR_XFLAGS_MASK to maybe only
>> >> FS_FILE_ATTR_MASK, so it's not too long.
>> >
>> > Losing the FS_XFLAGS_ prefix is not good IMO.
>> > I did want to offer a change to FS_XFLAGS_FILEATTR_MASK
>> > to be consistent with the rest of the collection/trait macros.
>>
>> Hmm, right, FS_XFLAGS_FILEATTR_MASK does indeed look better, though it
>> is getting a bit hard to distinguish between them when they have such a
>> long prefix.
>>
>> FS_*_FL are easier to read.
>> Actually, could we maybe do something like FSX_ as prefix, if the FS_
>> prefix is not that important?
>
> It's not that important, but..
>
>>
>> FSX_IMMUTABLE
>
> This is in the uapi and changing them in kernel will be a lot of churn

Yeah, I remembered that after sending the email lol.

>> FSX_PROJID
>>
>> FSX_RDONLY_MASK
>> FSX_FSXATTR_MASK
>> FSX_FILEATTR_MASK
>
> Those are fine by me

Nice, then I'll switch to them if the patch wouldn't be too large.

>>
>> or if FS_ is important:
>>
>> FS_FSX_IMMUTABLE
>> FS_FSX_PROJID
>
> Those not for same reason
>
>>
>> FS_FSX_RDONLY_MASK
>> FS_FSX_FSXATTR_MASK
>> FS_FSX_FILEATTR_MASK
>
> Those fine
>
>>
>> or maybe?
>>
>> FS_XFL_IMMUTABLE
>> FS_XFL_PROJID
>>
>> FS_XFL_RDONLY_MASK
>> FS_XFL_FSXATTR_MASK
>> FS_XFL_FILEATTR_MASK
>
> Those are worse than all of the above IMO
>
>>
>> or something else that is shorter, idk.
>>
>> >>
>> >> And at this point, we should consider all _MASKs to be frozen and only
>> >> expand FS_FILE_ATTR_MASK, with the exception of converterd FS_*_FL
>> >> flags.
>> >
>> > This is something that we can definitely document as a guideline -
>> > use the latest v1 syscall uapi for new flags, with the exception of
>> > xflags for existing FS_*_FL flags.
>>
>> Yes.
>>
>> > However, a filesystem can only report a new flag after it has opted into
>> > masks,
>>
>> Report as RW or as RO?
>>
>> Since for RO reporting it doesn't need to, it just needs to do that for
>> get (and actually, only for the wanted xflag, it probably doesn't even
>> need to report all its xflags in rw/ro masks apart from e.g. MAYSHARE...
>> or maybe not even in the masks, since on the set path vfs treats it as a
>> "legacy RMW"/VER0 filesystem).
>>
>
> Whatever guideline you write - if it makes sense its good,

Fair.

>> > so if a new flag requires converting many filesystems,
>> > it may not be realistic to maintain the freeze rule.
>> >
>> > Hopefully, the work on the may-share flag came just at the right time
>> > to allow for the ro_mask exception, so observing the guideline for
>> > new read-only flags seems doable.
>>
>> Yes, MAYSHARE for testing read-only, BTIME for testing read-write (and
>> read-only).
>>
>> >
>> >>
>> >> so:
>> >>
>> >> FS_XFLAGS_FSXATTR would have the ones that are in right now + all new
>> >> FS_*_FL converted ones (same for RDONLY and COMMON, etc)
>> >>
>> >> FS_FILE_ATTR_MASK would have all FS_XFLAGS_FSXATTR + all new ones
>> >> (MAYSHARE, BTIME, ...).
>> >>
>> >
>> > Yes, it sounds like we are converging :)
>>
>> Yes, though that has been my thinking since the first time I wrote
>> "FS_FILE_ATTR_MASK" for the ptime patch :D
>>
>
> Yeh this is a tough one
> and this is before the patch set got review from a wider audience...
> I praise your perseverance.

I really just want ptime or settable btime, lmao.

>
>> >> > Isn't PROJID in FS_XFLAGS_FILE_ATTR_MASK, but not in
>> >> > FS_XFLAGS_FSXATTR_MASK?
>> >> > Is there more to it than that?
>> >>
>> >> Currently it's set like this, and there shouldn't be anything more to
>> >> it.
>> >>
>> >
>> > Nice. Looking forward to v4.
>> > I hope I have some time to rest before, but probably not :)
>>
>> I should take >= 1 breaks too instead of working on this when I'm not
>> doing other stuff, but I already know I won't :)
>>
>
> Maybe if there is AI outage you can rest :D

I actually finished my normal tokens and using some API credits I got
for free right now, so maybe I'll take it as an excuse :)

Thanks,
koraynilay

> Thanks,
> Amir.



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-30 23:05 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29  2:42 [PATCH v3 0/5] Add f*_xflags_{rw,ro}_mask flags to the fileattr API koraynilay
2026-11-29  2:42 ` [PATCH v3 1/5] vfs: use goto out on error in vfs_fileattr_set() koraynilay
2026-11-29  9:32   ` Amir Goldstein
2026-11-29 13:23     ` koraynilay
2026-11-29  2:42 ` [PATCH v3 2/5] vfs: add xflags masks to fileattr API koraynilay
2026-11-29 13:10   ` Lauri Gates
2026-11-29 13:57     ` Amir Goldstein
2026-11-30 18:43     ` koraynilay
2026-11-30 19:44       ` Lauri Gates
2026-11-30 22:02         ` koraynilay
2026-11-29 14:23   ` Amir Goldstein
2026-11-29 21:44     ` koraynilay
2026-11-29 22:22       ` koraynilay
2026-11-30  0:00       ` Amir Goldstein
2026-11-30 11:23         ` koraynilay
2026-11-30 11:28           ` koraynilay
2026-11-30 15:53             ` Amir Goldstein
2026-11-30 17:22               ` koraynilay
2026-11-30 21:04                 ` Amir Goldstein
2026-11-30 21:25                   ` koraynilay
2026-11-30 21:29                     ` koraynilay
2026-11-30 22:54                     ` Amir Goldstein
2026-11-30 23:05                       ` koraynilay [this message]
2026-12-01 19:51                       ` koraynilay
2026-12-01 20:22                         ` Amir Goldstein
2026-12-01 21:22                           ` koraynilay
2026-12-01 20:43                   ` Lauri Gates
2026-12-01 21:23                     ` Amir Goldstein
2026-11-29  2:42 ` [PATCH v3 3/5] vfs: add COMPR/ENCRYPT xflags from FS_COMPR_FL/FS_ENCRYPT_FL koraynilay
2026-11-29 10:11   ` Amir Goldstein
2026-11-29 18:20     ` koraynilay
2026-11-29 21:30       ` Amir Goldstein
2026-11-29 21:55         ` koraynilay
2026-11-29  2:42 ` [PATCH v3 4/5] ntfs: switch to the new xflags fileattr API koraynilay
2026-11-29  9:12   ` Amir Goldstein
2026-11-29 17:51     ` koraynilay
2026-11-29 21:18       ` Amir Goldstein
2026-11-29 22:05         ` koraynilay
2026-11-29 22:20           ` Amir Goldstein
2026-11-29  2:42 ` [PATCH v3 5/5] docs: add fileattr API documentation koraynilay
2026-11-29 11:32   ` Amir Goldstein
2026-11-29 14:19     ` koraynilay
2026-11-29 22:11       ` Amir Goldstein
2026-11-30 13:33   ` Andrey Albershteyn
2026-11-30 14:10     ` koraynilay
2026-11-30 15:24       ` Amir Goldstein
2026-11-29  2:47 ` [PATCH v3 0/5] Add f*_xflags_{rw,ro}_mask flags to the fileattr API koraynilay

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=DN8X6ZGF78ZH.1OHQO5COG7NC7@gmail.com \
    --to=koray.fra@gmail.com \
    --cc=aalbersh@kernel.org \
    --cc=alex.aring@gmail.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=cel@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dgc@kernel.org \
    --cc=djwong@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=hch@infradead.org \
    --cc=hyc.lee@gmail.com \
    --cc=jack@suse.cz \
    --cc=jaegeuk@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=lauri.gates@gmail.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=ntfs@lists.linux.dev \
    --cc=pali@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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.