fs: prepare for extending file_get/setattr()
authorAmir Goldstein <amir73il@gmail.com>
Mon, 30 Jun 2025 16:20:15 +0000 (18:20 +0200)
committerChristian Brauner <brauner@kernel.org>
Wed, 2 Jul 2025 12:29:15 +0000 (14:29 +0200)
commit276e136bff7edcdecc6e206c81594ef06aa40743
tree98891883a030c3bdb889113c81530c9f509b91fb
parent474b155adf3927d2c944423045757b54aa1ca4de
fs: prepare for extending file_get/setattr()

We intend to add support for more xflags to selective filesystems and
We cannot rely on copy_struct_from_user() to detect this extension.

In preparation of extending the API, do not allow setting xflags unknown
by this kernel version.

Also do not pass the read-only flags and read-only field fsx_nextents to
filesystem.

These changes should not affect existing chattr programs that use the
ioctl to get fsxattr before setting the new values.

Link: https://lore.kernel.org/linux-fsdevel/20250216164029.20673-4-pali@kernel.org/
Cc: Pali Rohár <pali@kernel.org>
Cc: Andrey Albershteyn <aalbersh@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
Link: https://lore.kernel.org/20250630-xattrat-syscall-v6-5-c4e3bc35227b@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/file_attr.c
include/linux/fileattr.h