Re: [PATCH 0/3] Add f*_xflags_{rw,ro}_mask flags to the fileattr API
From: Amir Goldstein
Date: Mon Nov 23 2026 - 17:47:23 EST
On Mon, Nov 23, 2026 at 10:45 PM koraynilay <koray.fra@xxxxxxxxx> wrote:
>
> On Mon Nov 23, 2026 at 2:35 PM CET, Amir Goldstein wrote:
> > On Sun, Nov 22, 2026 at 1:09 AM koraynilay <koray.fra@xxxxxxxxx> wrote:
> >>
> >> This is a follow up patch series stemmed from [1] and [2], splitting the
> >> _mask change for the fileattr API into its own separate patch.
> >>
> >> The first patch is a preparatory patch so that the code in the patch
> >> after can be formatted better.
> >>
> >> The second patch is the actual implementation, which introduces:
> >> - fa_xflags_{rw,ro}_mask fields to struct file_attr
> >> - fsx_xflags_{rw,ro}_mask fields and has_masks selector to struct file_kattr
> >>
> >> These masks have the following semantics:
> >> - rw_mask:
> >> * for filesystems: advertise which xflags they support changing
> >> * for userspace: specify which xflags it wants to modify
> >> - ro_mask:
> >> * for filesystems: advertise which xflags they support only reading
> >> * for userspace: ignored
> >
> > Nice!
> > I think this API description is very clear and coherent
>
> By the way, should I use this description in the commit message (and
You could use that as a short TLDR intro
> integrate it with missing information before/after the bullet points),
> or should I keep the current one?
>
> (current one:)
> > This lets filesystems advertise their support for specific xflags, like
> > statx.stx_attributes_mask does, and userspace can specify only which
> > xflags it wants to change without needing a RMW cycle:
> > - on GET: each filesystem that wants to support this new API fills the
> > masks according to its supported and read-only xflags, then:
> > * for boolean xflags: it fills fsx_xflags with the current on-disk value
> > * for value xflags: it sets the xflag bit to 1 in fsx_xflags and the
> > xflag value in the struct field;
> > - on SET: userspace fills the rw_mask with the bits of the xflags it
> > wants to change, then:
> > * for boolean xflags: it provides the xflag value as a bit in fa_xflags
> > * for value xflags: it sets the xflag bit to 1 in fa_xflags and then
> > provides the value in the struct field; if the xflag bit is set to 0
> > instead, this informs the kernel to unset/clear that value.
You can keep it also but tbh UAPI documentation is more useful in
comments and in Documentation than in commit messages.
Thanks,
Amir.