Re: [PATCH v3 2/5] vfs: add xflags masks to fileattr API
From: Amir Goldstein
Date: Tue Dec 01 2026 - 15:22:30 EST
On Tue, Dec 1, 2026 at 8:51 PM koraynilay <koray.fra@xxxxxxxxx> wrote:
>
> 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@xxxxxxxxx> 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.
>
> (definition reminder:)
>
> /*
> * Writable xflags used to check and convert from masked request to unmasked
> * request.
> * Includes FS_XFLAG_PROJID because masked requests use it but unmasked
> * filesystems that support fsx_projid don't know about it (because
> * FS_IOC_FSSETXATTR has no FS_XFLAG_PROJID bit).
> */
If they don't know about it why don't we strip it?
This comment does not explain this at all.
Let me try:
/*
* xflags that can be changed on a filesystem that does not support masks.
* The VFS converts a masked request to an FS_IOC_FSSETXATTR style request
* for such a filesystem, so these are the writable xflags of that interface.
* FS_IOC_FSSETXATTR has no FS_XFLAG_PROJID, but it can change the project
* ID via fsx_projid. A masked request selects a project ID change with
* FS_XFLAG_PROJID, so it is allowed here and converted to fsx_projid.
*/
> #define FSX_FSXATTR_SET_MASK \
> ((FSX_FSXATTR_MASK & ~FSX_RDONLY_MASK) | FS_XFLAG_PROJID)
>
>
> Which of these do you think is better?
>
> FSX_FSXATTR_SET_MASK
> FSX_SET_MASK
> FSX_UNMASK_CONV_MASK
> FSX_UNMASKED_SET_MASK
> FSX_CONVERT_SET_MASK
> FSX_COMPAT_SET_MASK
FSX_FSXATTR_SET_MASK is ok.
None of the other names make much sense to me.
You could consider FSX_FSXATTR_MODIFIABLE
named after FS_FL_USER_MODIFIABLE.
I don't think it is better than _SET_MASK, but I could live with either.
Thanks,
Amir.