mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH v6 0/9] vfs: add O_CREAT|O_DIRECTORY to open*(2)
@ 2026-05-31 18:20 Jori Koolstra
  2026-05-31 18:20 ` [RFC PATCH v6 1/9] fs/namei.c: make lookup_last() use trailing_slashes() Jori Koolstra
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Jori Koolstra @ 2026-05-31 18:20 UTC (permalink / raw)
  To: NeilBrown, Al Viro, Aleksa Sarai, Christian Brauner
  Cc: Jori Koolstra, Jan Kara, Jeff Layton, Mateusz Guzik,
	linux-kernel, linux-fsdevel, Charles Mirabile

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).

Changes:
v6: split up the series in more steps. Call may_create_in_sticky() also
    for directories. Revert to old errnos on missing i_op functions
    instead of EOPNOTSUPP.
v5: fixed Sashiko reported issues [1]. Moved to EINVAL banning
    O_CREAT|O_DIRECTORY in each individual atomic_open implementation
    instead of in the generic atomic_open() in fs/namei.c.
    v3/4: fixed syzbot reported bugs
v2: don't introduce a new syscall (mkdirat2) but implement this
    functionality as O_CREAT|O_DIRECTORY in open*(2).

[1]: 
https://sashiko.dev/#/patchset/20260518165237.2084042-1-jkoolstra%40xs4all.nl



Jori Koolstra (9):
  fs/namei.c: make lookup_last() use trailing_slashes()
  fs/namei.c: move create error && negative dentry case in lookup_open
    up
  vfs: prepare vfs_creat|mkdir_no_perm for reuse in lookup_open()
  vfs: lookup_open(): move setting FMODE_CREATED up when calling
    create()
  vfs: lookup_open(): move audit_inode_child() and i_op->create check to
    before try_break_deleg()
  vfs: lookup_open(): use vfs_create_no_perm()
  vfs: add O_CREAT|O_DIRECTORY to open*(2)
  vfs: move O_IS_MKDIR check out atomic_open() to individual filesystems
  selftest: add tests for open*(O_CREAT|O_DIRECTORY)

 fs/9p/vfs_inode.c                             |   3 +
 fs/9p/vfs_inode_dotl.c                        |   3 +
 fs/ceph/file.c                                |   3 +
 fs/fuse/dir.c                                 |   3 +
 fs/gfs2/inode.c                               |   3 +
 fs/namei.c                                    | 213 ++++++++++++------
 fs/nfs/dir.c                                  |   3 +
 fs/nfs/file.c                                 |   3 +
 fs/open.c                                     |  25 +-
 fs/smb/client/dir.c                           |   3 +
 fs/vboxsf/dir.c                               |   3 +
 include/linux/fcntl.h                         |   7 +
 .../testing/selftests/filesystems/.gitignore  |   1 +
 tools/testing/selftests/filesystems/Makefile  |   4 +-
 tools/testing/selftests/filesystems/fclog.c   |   1 +
 .../filesystems/open_o_creat_o_dir.c          | 197 ++++++++++++++++
 16 files changed, 389 insertions(+), 86 deletions(-)
 create mode 100644 tools/testing/selftests/filesystems/open_o_creat_o_dir.c


base-commit: 174914ea551314c52a61713b9c4bde9e42d48073
-- 
2.54.0


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2026-06-14 18:39 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31 18:20 [RFC PATCH v6 0/9] vfs: add O_CREAT|O_DIRECTORY to open*(2) Jori Koolstra
2026-05-31 18:20 ` [RFC PATCH v6 1/9] fs/namei.c: make lookup_last() use trailing_slashes() Jori Koolstra
2026-06-01  2:09   ` NeilBrown
2026-05-31 18:20 ` [RFC PATCH v6 2/9] fs/namei.c: move create error && negative dentry case in lookup_open up Jori Koolstra
2026-06-01  2:16   ` NeilBrown
2026-05-31 18:20 ` [RFC PATCH v6 3/9] vfs: prepare vfs_creat|mkdir_no_perm for reuse in lookup_open() Jori Koolstra
2026-06-01  3:20   ` NeilBrown
2026-06-02 23:00   ` NeilBrown
2026-06-14 18:39     ` Jori Koolstra
2026-05-31 18:20 ` [RFC PATCH v6 4/9] vfs: lookup_open(): move setting FMODE_CREATED up when calling create() Jori Koolstra
2026-06-01  2:34   ` NeilBrown
2026-06-02 13:41     ` Christian Brauner
2026-06-03 13:19       ` Jori Koolstra
2026-05-31 18:20 ` [RFC PATCH v6 5/9] vfs: lookup_open(): move audit_inode_child() and i_op->create check to before try_break_deleg() Jori Koolstra
2026-06-01  2:56   ` NeilBrown
2026-06-01 16:27     ` Paul Moore
2026-06-14 18:36       ` Jori Koolstra
2026-05-31 18:20 ` [RFC PATCH v6 6/9] vfs: lookup_open(): use vfs_create_no_perm() Jori Koolstra
2026-05-31 18:20 ` [RFC PATCH v6 7/9] vfs: add O_CREAT|O_DIRECTORY to open*(2) Jori Koolstra
2026-06-01  3:16   ` NeilBrown
2026-06-14 18:27     ` Jori Koolstra
2026-05-31 18:20 ` [RFC PATCH v6 8/9] vfs: move O_IS_MKDIR check out atomic_open() to individual filesystems Jori Koolstra
2026-06-01  3:18   ` NeilBrown
2026-05-31 18:20 ` [RFC PATCH v6 9/9] selftest: add tests for open*(O_CREAT|O_DIRECTORY) Jori Koolstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®