Re: [PATCH v3 09/14] vfs: add O_CREAT|O_DIRECTORY to open*(2)
From: Jori Koolstra
Date: Thu Jul 09 2026 - 06:51:45 EST
> Op 09-07-2026 08:24 CEST schreef Christoph Hellwig <hch@xxxxxxxxxxxxx>:
>
>
> On Wed, Jul 08, 2026 at 04:39:54PM +0100, Pedro Falcato wrote:
> > Because it's a black box:
> > - Maybe this feature lands in 7.3 or 7.4 and enterprise kernels (and Android)
> > backport it to older releases on request (as a random example, XFS atomic
> > writes were added in 6.16, but were backported to 6.12 in SLES, and UEK 8,
> > and possibly RHEL/Ubuntu too)
> > - Maybe the feature is posteriously reverted, disabled, changed
> > - Upstream LTS also does its backports, so the O_CREAT | O_DIRECTORY EINVAL
> > only landed in 6.4, but was backported to 6.1, but not to 6.2 or 6.3, and
> > not to 5.15 or 5.10, and the behavior will again change as soon as this
> > lands
> > - Sometimes the kernel perfectly supports a feature but you're running under
> > a tight seccomp filter that rejects unknown syscalls (or ones that it can't
> > filter, like SYS_clone3), so you get a mysterious -ENOSYS that uname() will
> > not be able to explain.
> > - You can technically even be running under the uname26 personality and now
> > your uname() is completely nonsensical
>
> Exactly. NEw features need to be discoverable, and O_ flags that
> get ignored by old kernel are not.
Maybe just backport -EINVAL to every kernel since introducing openat2(2) then
that can be used as a test.
But that is an issue if openat2 is blocked. I don't know enough about blocking
syscalls to know if that is a big issue or not or whether it can be worked around.
But something like this seems reasonable.