]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: allow setting file attributes on special files
authorAndrey Albershteyn <aalbersh@redhat.com>
Mon, 4 Aug 2025 12:08:16 +0000 (14:08 +0200)
committerCarlos Maiolino <cem@kernel.org>
Thu, 28 Aug 2025 12:19:58 +0000 (14:19 +0200)
commit0239bd9fa445a21def88f7e76fe6e0414b2a4da0
treef79432ce135461c73e0cf55a50143d56dd1c5876
parent8a221004fe5288b66503699a329a6b623be13f91
xfs: allow setting file attributes on special files

XFS does't have file attributes manipulation ioctls for special
files. Changing or reading file attributes is rejected for them in
xfs_fileattr_*et().

In XFS, this is necessary to work for project quota directories.
When project is set up, xfs_quota opens and calls FS_IOC_SETFSXATTR on
every inode in the directory. However, special files are skipped due to
open() returning a special inode for them. So, they don't even get to
this check.

The recently added file_getattr/file_setattr will call xfs_fileattr_*et,
on special files. This patch allows reading/changing file attributes on
special files.

Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_ioctl.c