[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250217053727.3368579-1-neilb@suse.de>
Date: Mon, 17 Feb 2025 16:30:02 +1100
From: NeilBrown <neilb@...e.de>
To: Christian Brauner <brauner@...nel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Jan Kara <jack@...e.cz>
Cc: linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 0/3 RFC v2] change ->mkdir() and vfs_mkdir() to return a dentry
Here is a second attempt at this change. Guided by Al I have handled
other file systems which don't return a hashed positive dentry on success.
It is not always possible to provide a reliable answer. One example is
that cifs might find, after successfully creating a directory, that the
name now leads to a non-directory (due to a race with another client).
So callers of vfs_mkdir() need to cope with successful mkdir but no
usable dentry. There is nothing they can do to recover and must
continue gracefully. This failre mode is detected by the returned
dentry being unhashed.
ORIGINAL DESCRIPTION - updated to reflect changes.
This is a small set of patches which are needed before we can make the
locking on directory operations more fine grained. I think they are
useful even if we don't go that direction.
Some callers of vfs_mkdir() need to operate on the resulting directory
but cannot be guaranteed that the dentry will be hashed and positive on
success - another dentry might have been used.
This patch changes ->mkdir to return a dentry, changes several
filesystems to return the correct dentry, and changes vfs_mkdir() to
return that dentry, only performing a lookup as a last resort.
I have not Cc: the developers of all the individual filesystems NFS. I
or kernel-test-robot have build-tested all the changes. If anyone sees
this on fs-devel and wants to provide a pre-emptive ack I will collect
those and avoid further posting for those fs.
Thanks,
NeilBrown
[PATCH 1/3] Change inode_operations.mkdir to return struct dentry *
[PATCH 2/3] nfs: change mkdir inode_operation to return alternate
[PATCH 3/3] VFS: Change vfs_mkdir() to return the dentry.
Powered by blists - more mailing lists