On 2024-05-10 09:55:35, Dave Chinner wrote: > 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@xxxxxxxxxx> > > 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. > I see, thanks! I haven't thought about cross mount points. > 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... > Yeah, then this would probably will do it. > -Dave. > -- > Dave Chinner > david@xxxxxxxxxxxxx > -- - Andrey