Re: [PATCH v8 07/12] vfs: short-circuit MAY_WRITE access for O_DIRECTORY opens

From: Askar Safin

Date: Wed Nov 25 2026 - 18:25:09 EST


Jori Koolstra <jkoolstra@xxxxxxxxx>:
> > The problem is that "flags" contains an invalid value. The correct
> > error for that (according to open.2 man page) is EINVAL.
> >
>
> This is best probably. The counter is that I wanted to change errnos as little
> as possible. Now you get at least something that could already happen when
> you did a normal open(O_DIRECTORY). Were this designed from the start -EINVAL
> is obviously what is needed here.
>
> I dunno, not sure what other people think.

Now I think it should be changed to EINVAL, too.

--
Askar Safin