From: Dave Chinner <david@fromorbit.com>
To: Andrey Albershteyn <aalbersh@redhat.com>
Cc: linux-fsdevel@vgre.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/4] xfs: add XFS_IOC_SETFSXATTRAT and XFS_IOC_GETFSXATTRAT
Date: Fri, 10 May 2024 09:55:35 +1000 [thread overview]
Message-ID: <Zj1id6YGbEn4mUcg@dread.disaster.area> (raw)
In-Reply-To: <20240509151459.3622910-6-aalbersh@redhat.com>
On Thu, May 09, 2024 at 05:15:00PM +0200, Andrey Albershteyn wrote:
> XFS has project quotas which could be attached to a directory. All
> new inodes in these directories inherit project ID.
>
> The project is created from userspace by opening and calling
> FS_IOC_FSSETXATTR on each inode. This is not possible for special
> files such as FIFO, SOCK, BLK etc. as opening them return special
> inode from VFS. Therefore, some inodes are left with empty project
> ID.
>
> This patch adds new XFS ioctl which allows userspace, such as
> xfs_quota, to set project ID on special files. This will let
> xfs_quota set ID on all inodes and also reset it when project is
> removed.
>
> Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com>
This really should be a VFS layer file ioctl (like
FS_IOC_FSSETXATTR). Path resolution needs to be done before we call
into the destination filesystem as the path may cross mount points
and take us outside the filesytem that the parent dir points to.
IOWs, there should be no need to change anything in XFS to support
FS_IOC_[GS]ETFSXATTRAT() as once the path has been resolved to a
dentry at the VFS we can just call the existing
vfs_fileattr_get()/vfs_fileattr_set() functions to get/set the
xattr.
The changes to allow/deny setting attributes on special files
then goes into fileattr_set_prepare(), and with that I don't think
there's much that needs changing in XFS at all...
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2024-05-09 23:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-09 15:14 [PATCH 0/4] Introduce XFS_IOC_SETFSXATTRAT/XFS_IOC_GETFSXATTRAT ioctls Andrey Albershteyn
2024-05-09 15:14 ` [PATCH 1/4] fs: export copy_fsxattr_from_user() Andrey Albershteyn
2024-05-09 15:14 ` [PATCH 2/4] xfs: allow renames of project-less inodes Andrey Albershteyn
2024-05-09 23:28 ` Darrick J. Wong
2024-05-10 9:41 ` Andrey Albershteyn
2024-05-09 15:14 ` [PATCH 3/4] xfs: allow setting xattrs on special files Andrey Albershteyn
2024-05-09 23:34 ` Darrick J. Wong
2024-05-10 9:46 ` Andrey Albershteyn
2024-05-09 15:15 ` [PATCH 4/4] xfs: add XFS_IOC_SETFSXATTRAT and XFS_IOC_GETFSXATTRAT Andrey Albershteyn
2024-05-09 23:25 ` Darrick J. Wong
2024-05-10 10:38 ` Andrey Albershteyn
2024-05-09 23:55 ` Dave Chinner [this message]
2024-05-10 9:37 ` Andrey Albershteyn
2024-05-10 4:58 ` Christoph Hellwig
2024-05-10 9:50 ` Andrey Albershteyn
2024-05-10 15:10 ` 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=Zj1id6YGbEn4mUcg@dread.disaster.area \
--to=david@fromorbit.com \
--cc=aalbersh@redhat.com \
--cc=linux-fsdevel@vgre.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.