From: koraynilay <koray.fra@gmail.com>
To: Namjae Jeon <linkinjeon@kernel.org>,
Hyunchul Lee <hyc.lee@gmail.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>
Cc: "Chuck Lever" <cel@kernel.org>,
"Jeff Layton" <jlayton@kernel.org>, "Jan Kara" <jack@suse.cz>,
"Darrick J . Wong" <djwong@kernel.org>,
"Andrey Albershteyn" <aalbersh@kernel.org>,
"Amir Goldstein" <amir73il@gmail.com>,
"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, koraynilay <koray.fra@gmail.com>
Subject: [PATCH 0/3] Add f*_xflags_{rw,ro}_mask flags to the fileattr API
Date: Sun, 22 Nov 2026 01:08:53 +0100 [thread overview]
Message-ID: <20261122000856.536902-1-koray.fra@gmail.com> (raw)
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
(ro_mask for userspace was also proposed as a "verification mask"[3] but
I left out that semantic to keep this patch series more contained, and
can be added later if needed.)
This allows userspace to not have to do a RMW cycle when using the
file_[gs]etattr() syscalls, avoiding possible race conditions and
simplifying their usage.
Patch 2/3 also introduces the missing FS_XFLAG_PROJID flag so that
programs like chattr can leverage the new mask API.
FS_XFLAG_PROJID is kept out of the legacy FS_XFLAG_MASK and so it's
defined as part of a new FS_FILE_ATTR_XFLAGS_MASK group of xflags that
will be used moving forward for any new xflag (like the one proposed in [2]).
Patch 3/3 converts fs/ntfs to this new API, to show how it can benefit
filesystem drivers too.
The series has been tested across NTFS, ext4 (with project quotas), XFS
(project quotas and extent size hints), and Btrfs.
Thanks,
koraynilay
[1]: https://lore.kernel.org/CAOQ4uxg8aVcWyNiFDk8djdn-M3xJcu_7-kRxVq9jjFsbcGp1ew@mail.gmail.com/
[2]: https://lore.kernel.org/CAOQ4uxjVQ9cjV=_jBjQtNg9zCuWUEJT9KNYMKV+1jwBkHen5OA@mail.gmail.com/
[3]: https://lore.kernel.org/CAOQ4uxjCN-ekd18R-soD8tkGFnXjK0S1VdSNhq9b3Ev6y8K9jQ@mail.gmail.com/
koraynilay (3):
vfs: use goto out on error in vfs_fileattr_set()
vfs: add xflags mask to fileattr API
ntfs: switch to the new xflags fileattr API
fs/file_attr.c | 179 ++++++++++++++++++++++++++++++++-------
fs/ntfs/file.c | 63 +++++++-------
include/linux/fileattr.h | 13 ++-
include/uapi/linux/fs.h | 9 +-
4 files changed, 197 insertions(+), 67 deletions(-)
base-commit: 3857587d9d6fa44d40d1c73bde6a39f6f7a5216c
prerequisite-patch-id: 7af19117a27af492e3e525774310fb3a76700ffa
--
2.56.0
next reply other threads:[~2026-11-22 0:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 0:08 koraynilay [this message]
2026-11-22 0:08 ` [PATCH 1/3] vfs: use goto out on error in vfs_fileattr_set() koraynilay
2026-11-22 0:08 ` [PATCH 2/3] vfs: add xflags mask to fileattr API koraynilay
2026-11-22 0:08 ` [PATCH 3/3] ntfs: switch to the new xflags " 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=20261122000856.536902-1-koray.fra@gmail.com \
--to=koray.fra@gmail.com \
--cc=aalbersh@kernel.org \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=cel@kernel.org \
--cc=dgc@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=hyc.lee@gmail.com \
--cc=jack@suse.cz \
--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-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ntfs@lists.linux.dev \
--cc=pali@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®