| From: |
| NeilBrown <neilb-AT-ownmail.net> |
| To: |
| Alexander Viro <viro-AT-zeniv.linux.org.uk>, Christian Brauner <brauner-AT-kernel.org> |
| Subject: |
| VFS: prepare for changes to directory locking |
| Date: |
| Thu, 02 Jul 2026 09:29:00 +1000 |
| Message-ID: |
| <20260701233128.3356519-1-neilb@ownmail.net> |
| Cc: |
| Jan Kara <jack-AT-suse.cz>, linux-fsdevel-AT-vger.kernel.org |
| Archive-link: |
| Article |
These patches are part of some prep work to allow changes to directory
locking.
The short term goal is to invert the locking order between d_alloc_parallel()
and inode_lock() so that d_alloc_parallel() can (only) be called without
holding inode_lock(). This particularly requires filesystems not to use
d_drop() in the middle of an operation, which particularly requires the d_splice_alias()
change.
As it will require d_alloc_parallel() to NOT be called under the inode
lock, d_alloc_trylock() is added which CAN be used when failure is safe
(dcache priming in readdir).
I have other related patches which make changes to lookup_open() and
related code but I think it best to wait for the O_CREAT|O_DIRECTORY
patches to land first (unless it is decided that they won't land).
If these patches can land in a stable branch, I can start making changes
to various filesystems which depend on these.
Thanks,
NeilBrown
[PATCH 1/4] VFS: fix various typos in documentation for
[PATCH 2/4] VFS: enhance d_splice_alias() to handle in-lookup
[PATCH 3/4] VFS: introduce d_alloc_trylock()
[PATCH 4/4] VFS: add d_duplicate()