From: NeilBrown <neilb@suse.de>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
Miklos Szeredi <miklos@szeredi.hu>, Xiubo Li <xiubli@redhat.com>,
Ilya Dryomov <idryomov@gmail.com>,
Richard Weinberger <richard@nod.at>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
Johannes Berg <johannes@sipsolutions.net>,
Trond Myklebust <trondmy@kernel.org>,
Anna Schumaker <anna@kernel.org>,
Chuck Lever <chuck.lever@oracle.com>,
Jeff Layton <jlayton@kernel.org>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org,
linux-um@lists.infradead.org, ceph-devel@vger.kernel.org,
netfs@lists.linux.dev
Subject: [PATCH 0/6] Change ->mkdir() and vfs_mkdir() to return a dentry.
Date: Fri, 21 Feb 2025 10:36:29 +1100 [thread overview]
Message-ID: <20250220234630.983190-1-neilb@suse.de> (raw)
I'm posting this to a wider audience now as I think it is close to its final form.
I have not included every fs maintainer explicitly (though this patch touches every writable FS)
but hope that fsdevel will catch enough of those). I have included the affected clients
of vfs_mkdir: nfsd, smb/server, cachefiles, and the filesystems with non-trivial changes:
nfs, cephfs, hostfs, fuse.
mkdir is unique among object creation interfaces as there can only be
one dentry for an directory inode. There is a possibilty of races which
could result in the inode created by mkdir already having a dentry when
mkdir comes to attach one. To cope with this, three users of
vfs_mkdir() sometimes do a lookup to find the correct dentry when the
one that was passed in wasn't used. This lookup is clumsy and racy.
This patch set changes mkdir interface so that the filesystem can
provide the correct dentry. Some times this still requires a look-up
which can be racey, but having the filesystem do it limits this to only
when it is absolutely necessary.
So this series changes ->mkdir and vfs_mkdir() to allow a dentry to be
returned, changes a few filesystems to actually return a dentry
sometimes, and changes the callers of vfs_mkdir() to use the returned dentry.
I think it best if this could all land through the VFS tree as ask maitainers of:
cachefiles nfsd smb/server
hostfs ceph nfs fuse
to provide a Reviewed-by.
Thanks,
NeilBrown
next reply other threads:[~2025-02-20 23:46 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 23:36 NeilBrown [this message]
2025-02-20 23:36 ` [PATCH 1/6] Change inode_operations.mkdir to return struct dentry * NeilBrown
2025-02-22 4:19 ` Al Viro
2025-02-24 1:34 ` NeilBrown
2025-02-24 2:09 ` Al Viro
2025-02-24 3:09 ` NeilBrown
2025-02-24 15:56 ` Trond Myklebust
2025-02-26 2:09 ` NeilBrown
2025-02-26 2:34 ` Trond Myklebust
2025-02-26 3:18 ` NeilBrown
2025-02-26 3:35 ` Al Viro
2025-02-22 4:56 ` Al Viro
2025-02-20 23:36 ` [PATCH 2/6] hostfs: store inode in dentry after mkdir if possible NeilBrown
2025-02-21 13:17 ` Jeff Layton
2025-02-20 23:36 ` [PATCH 3/6] ceph: return the correct dentry on mkdir NeilBrown
2025-02-21 1:48 ` Viacheslav Dubeyko
2025-02-24 2:15 ` NeilBrown
2025-02-24 22:09 ` Viacheslav Dubeyko
2025-02-24 22:53 ` Jeff Layton
2025-02-24 23:29 ` NeilBrown
2025-02-21 13:31 ` Jeff Layton
2025-02-20 23:36 ` [PATCH 4/6] fuse: return correct dentry for ->mkdir NeilBrown
2025-02-21 13:39 ` Jeff Layton
2025-02-22 4:24 ` Al Viro
2025-02-24 2:26 ` NeilBrown
2025-02-24 2:53 ` Al Viro
2025-02-20 23:36 ` [PATCH 5/6] nfs: change mkdir inode_operation to return alternate dentry if needed NeilBrown
2025-02-22 4:41 ` Al Viro
2025-02-24 2:41 ` NeilBrown
2025-02-20 23:36 ` [PATCH 6/6] VFS: Change vfs_mkdir() to return the dentry NeilBrown
2025-02-21 14:25 ` Jeff Layton
2025-02-22 0:32 ` Chuck Lever
2025-02-24 2:51 ` NeilBrown
2025-02-24 14:22 ` Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250220234630.983190-1-neilb@suse.de \
--to=neilb@suse.de \
--cc=Dai.Ngo@oracle.com \
--cc=anna@kernel.org \
--cc=anton.ivanov@cambridgegreys.com \
--cc=brauner@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=chuck.lever@oracle.com \
--cc=idryomov@gmail.com \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=miklos@szeredi.hu \
--cc=netfs@lists.linux.dev \
--cc=okorniev@redhat.com \
--cc=richard@nod.at \
--cc=senozhatsky@chromium.org \
--cc=tom@talpey.com \
--cc=trondmy@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=xiubli@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox