diff options
| author | Andrey Albershteyn <aalbersh@redhat.com> | 2025-08-04 14:08:16 +0200 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2025-08-28 14:19:58 +0200 |
| commit | 0239bd9fa445a21def88f7e76fe6e0414b2a4da0 (patch) | |
| tree | f79432ce135461c73e0cf55a50143d56dd1c5876 /fs/xfs/xfs_ioctl.c | |
| parent | xfs: add .fileattr_set and fileattr_get callbacks for symlinks (diff) | |
| download | linux-0239bd9fa445a21def88f7e76fe6e0414b2a4da0.tar.gz linux-0239bd9fa445a21def88f7e76fe6e0414b2a4da0.zip | |
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>
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
| -rw-r--r-- | fs/xfs/xfs_ioctl.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index e1051a530a50..10a3a5160f4e 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -512,9 +512,6 @@ xfs_fileattr_get( { struct xfs_inode *ip = XFS_I(d_inode(dentry)); - if (d_is_special(dentry)) - return -ENOTTY; - xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_fill_fsxattr(ip, XFS_DATA_FORK, fa); xfs_iunlock(ip, XFS_ILOCK_SHARED); @@ -736,9 +733,6 @@ xfs_fileattr_set( trace_xfs_ioctl_setattr(ip); - if (d_is_special(dentry)) - return -ENOTTY; - if (!fa->fsx_valid) { if (fa->flags & ~(FS_IMMUTABLE_FL | FS_APPEND_FL | FS_NOATIME_FL | FS_NODUMP_FL | |
