linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Minor cleanup preparation for some dir-locking API changes
@ 2025-06-08 23:09 NeilBrown
  2025-06-08 23:09 ` [PATCH 1/5] VFS: merge lookup_one_qstr_excl_raw() back into lookup_one_qstr_excl() NeilBrown
                   ` (5 more replies)
  0 siblings, 6 replies; 25+ messages in thread
From: NeilBrown @ 2025-06-08 23:09 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara, Chuck Lever,
	Jeff Layton, Amir Goldstein, Jan Harkes, David Howells,
	Tyler Hicks, Miklos Szeredi, Carlos Maiolino
  Cc: linux-fsdevel, coda, codalist, linux-nfs, netfs, ecryptfs,
	linux-unionfs, linux-xfs, linux-kernel

The following 5 patches provide further cleanup that serves as
preparation for some dir-locking API changes that I want to make.  The
most interesting is the last which makes another change to vfs_mkdir().
As well as returning the dentry or consuming it on failure (a recent
change) it now also unlocks on failure.  This will be needed when we
transition to locking just the dentry, not the whole directory.

This leaves some rather clumsy code in overlayfs.  Overlayfs sometimes
takes a rename lock (two directories) and then possibly does a
vfs_mkdir() in one of those directories.  When that fails we now need to
unlock only the other directory.

I hope to go through overlayfs to narrow the directory locking so each
lock only covers a single operation (possibly including a lookup first).
That should remove the clumsiness and will also be needed for the
proposed API change.

As well as the cleanups here I have a few for smb/server.  I will send
those separately as they deserve careful review by the smb team and I
don't want them to be buried in this patch set.

After these, and the mentioned overlayfs changes, I have a series which
adds a collection of APIs with names like "lookup_and_lock()" which
combine the locking and the lookup, and then a set which changes all
code which currently locks a directory for name-based operations to
instead use the new look_and_lock() interfaces.  This will mean that the
changes to directory locking can be done in one central place.

After that there are a few more cleanups to stop filesystems from usng
d_drop() in the middle of name operations (at the end is OK, but not in
the middle) and then the core patches for this work which introduce an
alternate way to provide all the locking that the VFS needs for name
operations without taking i_rw_sem.  Filesystems can then opt into using
only this locking and to not depend on i_rw_sem.  This allows create and
remove of different names is the same directory to continue concurrently
with each other and with renames.  Renames are also concurrent though
cross-directory renames block some other cross-directory renames in the
same part of the tree.

Note that i_rw_sem will still be used for the target of rmdir, and will
still be held as a shared lock by readdir() so that we never try reading
in a directory being removed.  It might still be used (shared) for
lookups for the same reason, though I haven't completely settled my
design there yet.

Thanks,
NeilBrown

 [PATCH 1/5] VFS: merge lookup_one_qstr_excl_raw() back into
 [PATCH 2/5] VFS: Minor fixes for porting.rst
 [PATCH 3/5] coda: use iterate_dir() in coda_readdir()
 [PATCH 4/5] exportfs: use lookup_one_unlocked()
 [PATCH 5/5] Change vfs_mkdir() to unlock on failure.

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

end of thread, other threads:[~2025-06-12  7:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 23:09 [PATCH 0/5] Minor cleanup preparation for some dir-locking API changes NeilBrown
2025-06-08 23:09 ` [PATCH 1/5] VFS: merge lookup_one_qstr_excl_raw() back into lookup_one_qstr_excl() NeilBrown
2025-06-09 12:13   ` Jeff Layton
2025-06-08 23:09 ` [PATCH 2/5] VFS: Minor fixes for porting.rst NeilBrown
2025-06-09 12:13   ` Jeff Layton
2025-06-08 23:09 ` [PATCH 3/5] coda: use iterate_dir() in coda_readdir() NeilBrown
2025-06-09 12:17   ` Jeff Layton
2025-06-09 13:00     ` Jan Kara
2025-06-09 13:12       ` Jan Harkes
2025-06-09 13:21         ` Jeff Layton
2025-06-09 13:33           ` Jan Harkes
2025-06-09 14:02             ` Jeff Layton
2025-06-09 14:35   ` Jan Harkes
2025-06-08 23:09 ` [PATCH 4/5] exportfs: use lookup_one_unlocked() NeilBrown
2025-06-09 12:18   ` Jeff Layton
2025-06-09 14:01   ` Chuck Lever
2025-06-08 23:09 ` [PATCH 5/5] Change vfs_mkdir() to unlock on failure NeilBrown
2025-06-09  0:50   ` Al Viro
2025-06-09  5:22     ` NeilBrown
2025-06-09  5:34       ` Al Viro
2025-06-10  8:26         ` Al Viro
2025-06-09 12:23   ` Jeff Layton
2025-06-12  6:59   ` Amir Goldstein
2025-06-11 11:43 ` [PATCH 0/5] Minor cleanup preparation for some dir-locking API changes Christian Brauner
2025-06-11 22:35   ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).