Re: [PATCH v3 09/14] vfs: add O_CREAT|O_DIRECTORY to open*(2)

From: Christoph Hellwig

Date: Mon Jul 13 2026 - 05:54:42 EST


On Tue, Jul 07, 2026 at 12:04:18PM +0200, Christian Brauner wrote:
> I don't think any of this is really an argument worth considering.

It very much is.

> This is a lot of handwaving for the sake of portability and concerns
> about past API mistakes. To both: so what. If an API is useful it's
> useful, POSIX be damned. We're not going to be fenced in by some
> standard.
>
> 90% of our interfaces blow way past POSIX already - in most subsystems.
> If we'd back down ever time someone shows up with "what about POSIX"
> Linux would be irrelevant.

You can totaally ignore posix. We need an interface that is self
discoverable on Linux. Any combination of flags that was accepted
by previous kernels and gave different results than the new interface
do not qualify for that.

> It's been years since O_DIRECTORY | O_CREAT has been made consistent
> which means all LTS kernels have consistent behavior. We often make flag
> combinations work that didn't work or where inconsisent before. Nothing
> here is special at all.

No, we can't rely on something being backport to old enterprise/cloud
kernel. Doing so makes the interface unusable for actual applications.

>
> I appreciate the concern but even if this were to fall flat then
> worst-case we'd add a new flag and we'd still make that work. But I see
> no reason to not try the semantically obvious thing and make
> O_DIRECTORY | O_CREAT work.

New flag as in new O_ flag for open does not work because open never
checked flag. Which has always been a giant PITA, but as long as we're
dealing with legacy open(2) that is what it is.