Re: [PATCH v3 00/14] vfs: add O_CREAT|O_DIRECTORY to open*(2)
From: Christian Brauner
Date: Tue Jul 07 2026 - 06:54:59 EST
> This series implements new semantics for the O_CREAT|O_DIRECTORY flag
> combination for open*(2): perform a mkdir and open the resulting
> directory; return a pinning fd (which mkdir does not).
>
> Most of the work happens in "vfs: add O_CREAT|O_DIRECTORY to open*(2),"
> as may be expected. Before that there is some clean-up work and
> preparation. Also, the inconsistency in calling audit_inode_child() in
> lookup_open() versus vfs_create() path is addressed. The
> "vfs: short-circuit MAY_WRITE access for O_DIRECTORY opens" patch is
> also worth paying extra attention to as it short-circuits doomed opening
> of directories as writable. This check for regular files is now done
> very late in do_open(), but for O_CREAT|O_DIRECTORY this is unacceptable
> as this would create the directory and then still fail.
Please make sure that the series doesn't contain unrelated fixes.
Ideally just sent them as standalone cleanups/fixes. If you move a bunch
of code around to fix something else it makes it harder to keep track of
the actual changes that are required to make the feature work. That
should only be done if the fix is really small-ish. The
audit_inode_child() thing seems poised to cause a lot of churn and it
also requires some form of agreement what precisely should be audited.
That in turn means you need to get audit people involved. That means you
making your series harder to merge as a side-effect.
--
Christian Brauner <brauner@xxxxxxxxxx>