From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796480702; b=xmxLdfGB2J0W8nnXyBLcCSointSPtqTYHb9wM/DGdz14IdLw5VvB+MFaRKzXfnpCon0H yYwmGtXYs/ekUd8SnwdqV2wwySv23nF3CHV85EdwRdPXVJnU55kyIat1RXQ8JmpCdy+n7 a1eeRpEhNn5WGZ8es341Mxq4BFx6jAe/RcjOIEPFDqy/LNx0ETEvjwT7RvXF4U954Gc8M CngkRyoQzB5p8fF1Vvr3H9M+yCovRKWXK2Z+Iwy0sN07P1EPBQJMoGh4V9jFWswsSF1pC S4ODNVDob6/HngLw0xHokfPLQi5nmGRa+lueWhwCtoEAtar5uqvrT7MzluEEsCF8KXQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796480702; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=WXCLLHpLaZX0/OpUXeLxqwVvbpGcNWsjwAfsPIpGI/g=; b=4HxdVjJTNDdaeHiWyTNNWa4SKUgZmYfM8sOVvtVGMPCqRp1yO380HDosBhFuZ/n1+r9R 6L1EwpSaCBY7gXIbExlpwT0M/0ZTCY2DFSKoVoYizpjmPf8YK5WgUBuDmqLIw4tkk0105 Y1nwS00A1qSEtHIXy6qZjylC6BEBT+3JU1Jw8ZdQjk1aEu0GRz7Pm+BbUrr38fqN08HCh ax4Zxov5wo5mAspzEKsIW/s2EVz8SVssLEgcGG3njX5zaVQ3+xbDbgblJ63cLktFmlaNy mKBZnjyZm3lfF/Z9/Jk/kbLRbkEY5YtsQX/b/K/f/AOTFmSrYdkYieRdkUlF9R2Pzbg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aIshXr1A; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84D0A60A2633 for ; Sat, 5 Dec 2026 14:25:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 84D0A60A2633 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aIshXr1A Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4a3517554f7so16174285e9.2 for ; Sat, 05 Dec 2026 06:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796480700; x=1797085500; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=WXCLLHpLaZX0/OpUXeLxqwVvbpGcNWsjwAfsPIpGI/g=; b=aIshXr1A1LW2Wq9yWSOFt/rWXl4/SL6PY+MLWmmpUxrXdxYn2pjriigCyb2aWx5gcA S+g0xD5T88itIlcujLHPkGVymzQERY/NnP2CyK6yHipFn4bbwEugjo7oo/ss3JrvySn9 H3Av+FwWduz3QFkNI0ER+7lOJY1KYNp2g/dN8yKY0GRkXx+KAhx4G0NrHzSvOC0gfWXQ C+Ss3n5ANZWdpDIv11LhJeOjAnreLfFe9Pii3s1c17MNYSFDIvmiKNSB99yI/3UcvBJt Amq7HoqIk9XJSeh57Xnb6BRDwQWaVlAz5GTEvv3Td7VjE78Ut6ukzu6nZ0N1aNTarG77 58kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796480700; x=1797085500; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=WXCLLHpLaZX0/OpUXeLxqwVvbpGcNWsjwAfsPIpGI/g=; b=uFiojXNuDEufY8Q9wvWyN2WNzSIgn3ZTH1Pgq+HMAPZleEZ+8MNLRofxpL8zGy+Qib AUelUK2oqWoRIrqkFLN919Z0NQij4I8e2SDGCkF+jwxzdIk5XEsi7ATV4NaFIIPwzjPa Uu+oZ7JVVOVTr1UY6/XxJ7AoWPQFK+2sC/LuyqQATyLz9ZlkEKiVav/kPRtWQy+PXfTm 8PiMG30k9W4g/CL/JO5h15o5gxl7aE5KAcCG+eGNZin+CXlqaMPJULuwABqgvcZsL1/D msjvO+ulNOT19VD6ZUcS5/lTSj1HvIX3YbFpTafrkiVy7d0c91X1nTKacxHrMBkUdipK ZwKA== X-Forwarded-Encrypted: i=1; AL+hErHm5Hcs/v5F66gnhDmJPm92wPfDp9M38hMFn3B1oqJsykUDriAMZADwI0SbiVBsB9kGpclO0opzJv4=@vger.kernel.org X-Gm-Message-State: APuU4Z98em1Kw4V87sMKY/MLLU4ICERBOvZ5zqkmZ8eJayt0pZ8ekVNz aPqY8FQ8i7hmXM6QF5Lt1BSu7j3qv4qy/iO3x33+Wy/yZcdZ2P6Jf1J9 X-Gm-Gg: AZFdTZfuQtaCeE+oChTb5S1hJqsbDiYzsoO0tFZq/UFm/5iG5tmFBmYqSsiKO78iy3c 19BwlIcspnivj2E2ae7W0JXJhOEzCtfnpC73revCQg5xb4o4L9NH4RP19WwCuefKtIq0T67+oSP RUd85dSJSMNvTVxkdWoETTmWR7D9iDrmlr5iZi/M/wbBlVJXUFW+q6ULvuggGffb347t0/TYduq ZPfa0ogEvncJ+5wj/FXZNjjUX84CouOi9FUQ7mTPfeJN9JrOYW/EGFdSZ0qokIxQBBFY0gfx79X zXmyDq5+LMkZQk1Ye75VGnkeLpnOW9gHcuTu1HFMAE6bIxcJJiK/GaEZ11b9gHVO442HiwR9LxX W0I2eWBXpXU3qJ7Tzm6ZSEZZkn2NGUVKUCidmeVOv6cZPN7RyBdrGM5qhD7FuM/w3I/vB+zaZeI VYsac1pMtMfQCLvgwCLq7JSR+gZonYaCNYSbTOvn9j3dtXm2vwTrF0mXN9Xv0ZUNPIBGROAiCRU Tr293PscXXGg+jXusIlDcVUcoFqDYpgj8qPikCD2ZA6Ds7S+Zil3+8pp3iUoockO9iPbYb6+hOk 206xlHGaUB4bZzvVqZ0x+vYA X-Received: by 2002:a05:600c:1384:b0:4a3:5d64:df91 with SMTP id 5b1f17b1804b1-4bbeb8b930emr108764705e9.18.1796480699829; Sat, 05 Dec 2026 06:24:59 -0800 (PST) Received: from infinity ([2001:b07:5d26:7a6a:365a:60ff:fe0d:cfc6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d174d08d42sm10776969f8f.55.2026.12.05.06.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 06:24:59 -0800 (PST) From: koraynilay To: Namjae Jeon , Hyunchul Lee , Jonathan Corbet , Eric Biggers , "Theodore Y . Ts'o" , Jaegeuk Kim , Alexander Viro , Christian Brauner Cc: Shuah Khan , Randy Dunlap , Chuck Lever , Jeff Layton , Jan Kara , Alexander Aring , "Darrick J . Wong" , Andrey Albershteyn , Amir Goldstein , Miklos Szeredi , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Lauri Gates , Christoph Hellwig , Dave Chinner , 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, koraynilay Subject: [PATCH v5 06/12] fs: add UAPI implementation of xflags masks to fileattr API Date: Sat, 5 Dec 2026 15:24:05 +0100 Message-ID: <20261205142411.164484-7-koray.fra@gmail.com> X-Mailer: git-send-email 2.56.1.dirty In-Reply-To: <20261205142411.164484-1-koray.fra@gmail.com> References: <20261205142411.164484-1-koray.fra@gmail.com> X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add fa_xflags_rw_mask and fa_xflags_ro_mask to struct file_attr, both __u64 to match fa_xflags' size, and bump FILE_ATTR_SIZE_LATEST to FILE_ATTR_SIZE_VER1. Add FSX_FILEATTR_MASK macro to define VER1+ xflags, even though we have none yet, since it makes the code clearer. Add AT_FILEATTR_MASKS at_flags option that userspace needs to pass (with usize >= FILE_ATTR_SIZE_VER1) in order to be able to use masks, otherwise normal FS_IOC_FSSETXATTR semantics are used. Without AT_FILEATTR_MASKS: - on GET: set fa_xflags_rw_mask and fa_xflags_ro_mask to 0 and strip new xflags added in or after VER1, so older programs doing RMW don't pass them back on SET; - on SET: reject the operation with -EINVAL if fa_xflags_rw_mask or fa_xflags_ro_mask is non-zero; if they're zero, convert the input as necessary for masks filesystems or do normal RMW for non-masks filesystems. With AT_FILEATTR_MASKS: - on GET: if the filesystem supports masks, they will be filled, otherwise they will be zero, either way return the full struct; - on SET: convert the input as necessary for non-masks filesystems or pass the input directly to the filesystem if it supports masks; if the rw_mask is 0, reject it with -EINVAL; also reject with -EINVAL if a value xflag is in fa_xflags_rw_mask and it's cleared in fa_xflags, but the value field is non-zero. Signed-off-by: koraynilay --- fs/file_attr.c | 104 ++++++++++++++++++++++++++++++------- include/linux/fileattr.h | 9 +++- include/uapi/linux/fcntl.h | 6 +++ include/uapi/linux/fs.h | 31 ++++++++++- 4 files changed, 127 insertions(+), 23 deletions(-) diff --git a/fs/file_attr.c b/fs/file_attr.c index 2cc06b5117f8..8b9785447e72 100644 --- a/fs/file_attr.c +++ b/fs/file_attr.c @@ -116,10 +116,10 @@ int vfs_fileattr_get(struct dentry *dentry, struct file_kattr *fa) return error; if (fa->has_masks) { - fa->fsx_xflags_rw_mask &= FSX_FSXATTR_MASK; - fa->fsx_xflags_ro_mask &= FSX_FSXATTR_MASK; + fa->fsx_xflags_rw_mask &= FSX_FILEATTR_MASK; + fa->fsx_xflags_ro_mask &= FSX_FILEATTR_MASK; } - fa->fsx_xflags &= FSX_FSXATTR_MASK; + fa->fsx_xflags &= FSX_FILEATTR_MASK; return 0; } @@ -128,10 +128,13 @@ EXPORT_SYMBOL(vfs_fileattr_get); static void fileattr_to_file_attr(const struct file_kattr *fa, struct file_attr *fattr) { - __u32 mask = FSX_FSXATTR_MASK; - memset(fattr, 0, sizeof(struct file_attr)); - fattr->fa_xflags = fa->fsx_xflags & mask; + /* Pass the masks to userspace if underlying fs uses them. */ + if (fa->has_masks) { + fattr->fa_xflags_rw_mask = fa->fsx_xflags_rw_mask; + fattr->fa_xflags_ro_mask = fa->fsx_xflags_ro_mask; + } + fattr->fa_xflags = fa->fsx_xflags; fattr->fa_extsize = fa->fsx_extsize; fattr->fa_nextents = fa->fsx_nextents; fattr->fa_projid = fa->fsx_projid; @@ -167,15 +170,50 @@ EXPORT_SYMBOL(copy_fsxattr_to_user); static int file_attr_to_fileattr(const struct file_attr *fattr, struct file_kattr *fa) { - __u64 mask = FSX_FSXATTR_MASK; + bool use_masks = fa->use_masks && fa->has_masks; + u64 mask = use_masks ? FSX_FILEATTR_MASK : FSX_FSXATTR_MASK; + u64 rw_user_mask = fattr->fa_xflags_rw_mask; if (fattr->fa_xflags & ~mask) return -EINVAL; - fileattr_fill_xflags(fa, fattr->fa_xflags & ~FSX_RDONLY_MASK); - fa->fsx_extsize = fattr->fa_extsize; - fa->fsx_projid = fattr->fa_projid; - fa->fsx_cowextsize = fattr->fa_cowextsize; + if (!use_masks) { + fileattr_fill_xflags(fa, fattr->fa_xflags & ~FSX_RDONLY_MASK); + fa->fsx_extsize = fattr->fa_extsize; + fa->fsx_projid = fattr->fa_projid; + fa->fsx_cowextsize = fattr->fa_cowextsize; + return 0; + } + + if (rw_user_mask & ~FSX_FILEATTR_MASK) + return -EINVAL; + + /* + * Pass xflags clamped to the rw_mask, so the rest of the code can + * assume that if a flag is not in fsx_xflags, it isn't being changed. + */ + fileattr_fill_xflags(fa, fattr->fa_xflags & rw_user_mask); + fa->fsx_xflags_rw_mask = rw_user_mask; + + /* + * For value attributes, clearing the xflag bit in fa_xflags while + * selecting it in rw_mask requires the field value to be 0, to prevent + * accidental resets. + */ + if (fa->fsx_xflags & FSX_EXTSIZE_MASK) + fa->fsx_extsize = fattr->fa_extsize; + else if ((rw_user_mask & FSX_EXTSIZE_MASK) && + fattr->fa_extsize) + return -EINVAL; + else + fa->fsx_extsize = 0; + + if (fa->fsx_xflags & FS_XFLAG_COWEXTSIZE) + fa->fsx_cowextsize = fattr->fa_cowextsize; + else if ((rw_user_mask & FS_XFLAG_COWEXTSIZE) && fattr->fa_cowextsize) + return -EINVAL; + else + fa->fsx_cowextsize = 0; return 0; } @@ -377,7 +415,7 @@ static int fileattr_set_prepare(struct inode *inode, struct file_kattr *fa) { u32 rw_user_mask = fa->has_masks ? - fa->fsx_xflags_rw_mask : FSX_FSXATTR_MASK; + fa->fsx_xflags_rw_mask : FSX_FILEATTR_MASK; u32 changed = 0; int err; @@ -593,7 +631,8 @@ SYSCALL_DEFINE5(file_getattr, int, dfd, const char __user *, filename, BUILD_BUG_ON(sizeof(struct file_attr) < FILE_ATTR_SIZE_VER0); BUILD_BUG_ON(sizeof(struct file_attr) != FILE_ATTR_SIZE_LATEST); - if ((at_flags & ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH)) != 0) + if ((at_flags & + ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH | AT_FILEATTR_MASKS)) != 0) return -EINVAL; if (!(at_flags & AT_SYMLINK_NOFOLLOW)) @@ -602,7 +641,10 @@ SYSCALL_DEFINE5(file_getattr, int, dfd, const char __user *, filename, if (usize > PAGE_SIZE) return -E2BIG; - if (usize < FILE_ATTR_SIZE_VER0) + if (usize != FILE_ATTR_SIZE_VER0 && usize < FILE_ATTR_SIZE_VER1) + return -EINVAL; + + if ((at_flags & AT_FILEATTR_MASKS) && usize < FILE_ATTR_SIZE_VER1) return -EINVAL; CLASS(filename_maybe_null, name)(filename, at_flags); @@ -627,6 +669,17 @@ SYSCALL_DEFINE5(file_getattr, int, dfd, const char __user *, filename, return error; fileattr_to_file_attr(&fa, &fattr); + /* + * Caller doesn't know about masks, so it also doesn't know about + * xflags added in or after VER1. + * Zero out the masks and strip VER1+ xflags. + */ + if (!(at_flags & AT_FILEATTR_MASKS)) { + fattr.fa_xflags &= FSX_FSXATTR_MASK; + fattr.fa_xflags_rw_mask = 0; + fattr.fa_xflags_ro_mask = 0; + } + error = copy_struct_to_user(ufattr, usize, &fattr, sizeof(struct file_attr), NULL); @@ -646,7 +699,8 @@ SYSCALL_DEFINE5(file_setattr, int, dfd, const char __user *, filename, BUILD_BUG_ON(sizeof(struct file_attr) < FILE_ATTR_SIZE_VER0); BUILD_BUG_ON(sizeof(struct file_attr) != FILE_ATTR_SIZE_LATEST); - if ((at_flags & ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH)) != 0) + if ((at_flags & + ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH | AT_FILEATTR_MASKS)) != 0) return -EINVAL; if (!(at_flags & AT_SYMLINK_NOFOLLOW)) @@ -655,7 +709,10 @@ SYSCALL_DEFINE5(file_setattr, int, dfd, const char __user *, filename, if (usize > PAGE_SIZE) return -E2BIG; - if (usize < FILE_ATTR_SIZE_VER0) + if (usize != FILE_ATTR_SIZE_VER0 && usize < FILE_ATTR_SIZE_VER1) + return -EINVAL; + + if ((at_flags & AT_FILEATTR_MASKS) && usize < FILE_ATTR_SIZE_VER1) return -EINVAL; error = copy_struct_from_user(&fattr, sizeof(struct file_attr), ufattr, @@ -663,9 +720,9 @@ SYSCALL_DEFINE5(file_setattr, int, dfd, const char __user *, filename, if (error) return error; - error = file_attr_to_fileattr(&fattr, &fa); - if (error) - return error; + if (!(at_flags & AT_FILEATTR_MASKS) && + (fattr.fa_xflags_rw_mask || fattr.fa_xflags_ro_mask)) + return -EINVAL; CLASS(filename_maybe_null, name)(filename, at_flags); if (!name && dfd >= 0) { @@ -682,6 +739,15 @@ SYSCALL_DEFINE5(file_setattr, int, dfd, const char __user *, filename, return error; } + if (at_flags & AT_FILEATTR_MASKS) { + fa.has_masks = true; + fa.use_masks = true; + } + + error = file_attr_to_fileattr(&fattr, &fa); + if (error) + return error; + error = mnt_want_write(filepath.mnt); if (!error) { error = vfs_fileattr_set(mnt_idmap(filepath.mnt), diff --git a/include/linux/fileattr.h b/include/linux/fileattr.h index ef835436550d..adb586e21fd5 100644 --- a/include/linux/fileattr.h +++ b/include/linux/fileattr.h @@ -5,7 +5,8 @@ /* Version UAPI's struct file_attr based on size */ #define FILE_ATTR_SIZE_VER0 24 -#define FILE_ATTR_SIZE_LATEST FILE_ATTR_SIZE_VER0 +#define FILE_ATTR_SIZE_VER1 40 +#define FILE_ATTR_SIZE_LATEST FILE_ATTR_SIZE_VER1 /* * FS_COMMON_FL/FSX_COMMON are preserved through an RMW cycle via either UAPI @@ -46,11 +47,15 @@ #define FSX_EXTSIZE_MASK \ (FS_XFLAG_EXTSIZE | FS_XFLAG_EXTSZINHERIT) -/* Flags supported by FS_IOC_FS[GS]ETXATTR and file_[gs]etattr() */ +/* Flags supported by FS_IOC_FS[GS]ETXATTR and VER0 file_[gs]etattr() */ #define FSX_FSXATTR_MASK \ (FSX_COMMON | FSX_RDONLY_MASK | FSX_VALUES_MASK | \ FSX_DIRONLY_MASK | FSX_MISC_MASK) +/* All xflags supported by VER1+ file_[gs]etattr() with AT_FILEATTR_MASKS */ +#define FSX_FILEATTR_MASK \ + (FSX_FSXATTR_MASK) + /* * Merged interface for miscellaneous file attributes. 'flags' originates from * ext* and 'fsx_flags' from xfs. There's some overlap between the two, which diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h index faa63d0b60d2..7347efb3df3c 100644 --- a/include/uapi/linux/fcntl.h +++ b/include/uapi/linux/fcntl.h @@ -191,4 +191,10 @@ struct delegation { #define AT_EXECVE_CHECK 0x10000 /* Only perform a check if execution would be allowed. */ +/* Flags for file_getattr(2) / file_setattr(2). */ +#define AT_FILEATTR_MASKS 0x001 /* Advertise knowing and being able to + handle the struct file_attr fields + fa_xflags_rw_mask and + fa_xflags_ro_mask */ + #endif /* _UAPI_LINUX_FCNTL_H */ diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index f77e2b929f6d..d402db1a2254 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -225,9 +225,34 @@ struct fsxattr { unsigned char fsx_pad[8]; }; -/* - * Variable size structure for file_[sg]et_attr(). +/** + * struct file_attr - Variable size structure for file_getattr() / file_setattr(). + * + * @fa_xflags: Bit mask of zero or more FS_XFLAG_* file attribute flags to be + * set/unset (in) or currently enabled (out) on the inode. See + * :ref:`Flag Reference ` for a list of flags. + * @fa_extsize: Extent size allocator hint in bytes, value of the + * FS_XFLAG_EXTSIZE/FS_XFLAG_EXTSZINHERIT xflag. This value + * suggests a preferred extent size for new allocations. (in/out) + * @fa_nextents: Number of data extents in the file, read-only. Filled in by + * file_getattr(2) and ignored by file_setattr(2). (out) + * @fa_projid: Project identifier. Used by quota systems quotactl(2) to group + * related files. (in/out) + * @fa_cowextsize: Copy-on-Write (CoW) extent size hint in bytes, value of + * FS_XFLAG_COWEXTSIZE. This value suggests a preferred extent + * size for CoW operations. (in/out) + * @fa_xflags_rw_mask: Bit mask of writable xflags supported by the filesystem + * (out). Bit mask of xflags that need to be set to their + * corresponding on/off state in @fa_xflags and, if present, + * to their @fa_* value (in) ("flags that userspace wants + * to change"). See :ref:`Masks ` for details. + * @fa_xflags_ro_mask: Bit mask of read-only xflags supported by the filesystem + * (out). See :ref:`Masks ` for details. * + * Note: @fa_xflags_rw_mask and @fa_xflags_ro_mask need the + * ``AT_FILEATTR_MASKS`` at_flag to be used. + */ +/* * Note. This is alternative to the structure 'struct file_kattr'/'struct fsxattr'. * As this structure is passed to/from userspace with its size, this can * be versioned based on the size. @@ -238,6 +263,8 @@ struct file_attr { __u32 fa_nextents; /* nextents field value (get) */ __u32 fa_projid; /* project identifier (get/set) */ __u32 fa_cowextsize; /* CoW extsize field value (get/set) */ + __u64 fa_xflags_rw_mask;/* supported writable xflags (get) / flags to set (set) */ + __u64 fa_xflags_ro_mask;/* supported read-only xflags (get) */ }; /* -- 2.56.1.dirty