From: "Darrick J. Wong" <djwong@kernel.org>
To: Andrey Albershteyn <aalbersh@redhat.com>
Cc: cem@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs: allow setting xattrs on special files
Date: Tue, 29 Jul 2025 07:32:54 -0700 [thread overview]
Message-ID: <20250729143254.GZ2672049@frogsfrogsfrogs> (raw)
In-Reply-To: <20250729-xfs-xattrat-v1-2-7b392eee3587@kernel.org>
On Tue, Jul 29, 2025 at 01:00:36PM +0200, Andrey Albershteyn wrote:
> From: Andrey Albershteyn <aalbersh@redhat.com>
>
> XFS does't have extended attributes manipulation ioctls for special
> files. Changing or reading file extended attributes is rejected for them
"extended file attributes" or "fileattrs" as Amir suggested,
but never "extended attributes" because that's a separate thing.
(no need to drop the rvb over this)
--D
> 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 extended file
> attributes on special files.
>
> Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> ---
> fs/xfs/xfs_ioctl.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index fe1f74a3b6a3..f3c89172cc27 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 |
>
> --
> 2.49.0
>
>
next prev parent reply other threads:[~2025-07-29 14:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 11:00 [PATCH 0/3] Use new syscalls to set filesystem inode attributes on any inode Andrey Albershteyn
2025-07-29 11:00 ` [PATCH 1/3] xfs: allow renames of project-less inodes Andrey Albershteyn
2025-07-29 11:00 ` [PATCH 2/3] xfs: allow setting xattrs on special files Andrey Albershteyn
2025-07-29 14:32 ` Darrick J. Wong [this message]
2025-07-29 14:55 ` Andrey Albershteyn
2025-07-29 11:00 ` [PATCH 3/3] xfs: add .fileattr_set and fileattr_get callbacks for symlinks Andrey Albershteyn
2025-07-29 14:34 ` [PATCH 0/3] Use new syscalls to set filesystem inode attributes on any inode Darrick J. Wong
2025-07-29 15:50 ` Andrey Albershteyn
2025-07-29 15:52 ` Darrick J. Wong
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=20250729143254.GZ2672049@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=aalbersh@redhat.com \
--cc=cem@kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).