Re: [PATCH 2/3] xattrat: accept empty O_PATH file descriptors

From: Christian Brauner

Date: Wed Jul 01 2026 - 04:34:43 EST


On 2026-06-30 15:05:03+02:00, Andreas Gruenbacher wrote:
> On Tue, Jun 30, 2026 at 2:33 PM Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> > On 2026-06-30 14:06 +0200, Andreas Gruenbacher wrote:
> >
> > I'm very confused why the f*at() variants are supposed to accept O_PATH
> > but the f*() aren't? What's the point?
>
> Oh, I see. To keep things consistent with fchmod() and fchown() vs.
> fchmodat() and fchownat(): the former two also don't accept O_PATH
> file descriptors, while the latter two do.

Right, I saw that and wondered about that there too. I guess it makes
some sense in that nothing about O_PATH at this point is consistent
anymore. Will be fun to document what exactly works and doesn't work on
the manpage...

So then I think we should refactor fs/xattr.c similar to how we did it
for fch*() and fch*at(). So that f*xattr() call CLASS(fd, ...) and
f*xattrat() call CLASS(fd_raw, ...).

This should also make it a lot easier to follow, hopefully.