Re: [PATCH v2] xattrat: accept empty O_PATH file descriptors
From: Andreas Gruenbacher
Date: Fri Jul 31 2026 - 10:25:48 EST
On Fri, Jul 31, 2026 at 3:26 PM Christian Brauner <brauner@xxxxxxxxxx> wrote:
> On 2026-07-30 22:34 +0200, Andreas Gruenbacher wrote:
> > On Thu, Jul 30, 2026 at 8:49 PM Christian Brauner <brauner@xxxxxxxxxx> wrote:
> > > On 2026-07-22 17:10 +0200, Andreas Gruenbacher wrote:
> > > > Christian,
> > > >
> > > > here's an updated patch for making the *xattrat() system calls accept
> > > > O_PATH file descriptors.
> > > >
> > > > Compared to the previous version (see the discussion at [*]), this
> > > > version adds a fd_maybe_raw cleanup class that uses either fdget() or
> > > > fdget_raw() depending on which kinds of file descriptors are acceptable.
> > > > That's still a but ugly, but all the alternatives I could come up with
> > > > are much worse.
> > > >
> > > > [*] https://lore.kernel.org/linux-fsdevel/20260701191649.175871-1-agruenba@xxxxxxxxxx/
> > >
> > > Thank you. How do you feel about?
> >
> > I don't think it's an improvement; see below.
>
> Do you see other users outside of fs/xattr.c that would use this new fd
> class. If not it might be useful to just have a local version of this in
> fs/xattr.c?
I hope nothing else will use fd_maybe_raw, but hiding it in fs/xattr.c
still doesn't seem like a good idea. Do you insist on having it moved?
Thanks,
Andreas