Re: [PATCH v3 09/14] vfs: add O_CREAT|O_DIRECTORY to open*(2)
From: Christian Brauner
Date: Fri Jul 24 2026 - 05:41:02 EST
> Anyway, it is up to Christian.
Please send a new version with support in openat() and openat2().
Fwiw, we have have not just a few examples of combinations that either
were ignored then became meaningful (that's something we shouldn't do)
but also were meaningful, then were rejected (something that's fine) and
then reused. Things I remember from direct or indirect involvement:
- CLONE_STOPPED -> CLONE_NEWCGROUP
- CLONE_PID -> CLONE_PIDFD
- O_TMPFILE -> __O_TMPFILE|O_DIRECTORY
I'm very happy to compromise on a lot of things - I think I've proven
that quite a lot in the past. But here we're deliberately crippling a
useful extension for userspace for a flag combination _I personally_
made return EINVAL years ago with the express reason stated in the
commit message to 43b450632676 ("open: return EINVAL for O_DIRECTORY |
O_CREAT"):
> So let's simply return EINVAL categorically for O_DIRECTORY | O_CREAT
> combinations. In addition to cleaning up the old bug this also opens up
> the possiblity to make that flag combination do something more intuitive
> in the future.
Thanks for the patience.