Re: [PATCH v2] xattrat: accept empty O_PATH file descriptors
Andreas Gruenbacher <[email protected]> Fri, 31 Jul 2026 16:14:33 +0200
| Newsgroups | org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAHc6FU7JQsrqf064yzG8_nDovSFwNCd+-cfmJE=_9pQLLYLdXw@mail.gmail.com> |
On Fri, Jul 31, 2026 at 3:26 PM Christian Brauner <[email protected]> wrote: > On 2026-07-30 22:34 +0200, Andreas Gruenbacher wrote: > > On Thu, Jul 30, 2026 at 8:49 PM Christian Brauner <[email protected]> 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/[email protected]/ > > > > > > 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