Re: [PATCH v6 0/6] fs: introduce file_getattr and file_setattr syscalls

Christian Brauner
2025-07-07T12:19:30Z

On Mon, Jul 07, 2025 at 02:05:10PM +0200, Andrey Albershteyn wrote:
> On 2025-07-01 14:29:42, Christian Brauner wrote:
> > On Mon, Jun 30, 2025 at 06:20:10PM +0200, Andrey Albershteyn wrote:
> > > This patchset introduced two new syscalls file_getattr() and
> > > file_setattr(). These syscalls are similar to FS_IOC_FSSETXATTR ioctl()
> > > except they use *at() semantics. Therefore, there's no need to open the
> > > file to get a fd.
> > >
> > > These syscalls allow userspace to set filesystem inode attributes on
> > > special files. One of the usage examples is XFS quota projects.
> > >
> > > XFS has project quotas which could be attached to a directory. All
> > > new inodes in these directories inherit project ID set on parent
> > > directory.
> > >
> > > 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. Therefore, some inodes are left
> > > with empty project ID. Those inodes then are not shown in the quota
> > > accounting but still exist in the directory. This is not critical but in
> > > the case when special files are created in the directory with already
> > > existing project quota, these new inodes inherit extended attributes.
> > > This creates a mix of special files with and without attributes.
> > > Moreover, special files with attributes don't have a possibility to
> > > become clear or change the attributes. This, in turn, prevents userspace
> > > from re-creating quota project on these existing files.
> >
> > Only small nits I'm going to comment on that I can fix myself.
> > Otherwise looks great.
> >
>
> Hi Christian,
>
> Let me know if you would like a new revision with all the comments
> included (and your patch on file_kattr rename) or you good with
> applying them while commit

It's all been in -next for a few days already. :)