[PATCH v2 0/5] afs: prepare for VFS locking changes.
NeilBrown
neilb at ownmail.net
Mon Sep 28 19:29:26 PDT 2026
The previous version of this series has a problem in 3/5 in that
it didn't handle an error from afs_lookup() properly - such errors
should be fatal and not cause a retry.
Original intro:
I am working on changes to directory locking. The medium term goal is
to lift d_alloc_parallel() locking above i_rwsem, so d_alloc_paralle()
can be run unlocked, and consequently cannot be called when ->i_rwsem is
held.
The requires:
1/ the d_alloc_parallel() not be called while i_rwsem is held. NFS does
this in a few places. New interfaces d_alloc_trylock() and d_duplicate()
are now available and can be used instead. In one case we must drop
and reclaim the lock and LOOKUP_SHARED helps with that.
2/ a dentry must not be d_drop()ed while an operation is ongoing, as an
unlocked d_alloc_parallel() would then be able to create a new
dentry with the same name. In particular d_rehash() must be phased
out as it won't be safe. This particularly affect the mechanism to
block lookups/revalidates while an unlink/rename is happening.
The mechanism is changed to use one similar to how NFS addresses this
needed, though using the new LOOKUP_PRIVATE flag.
The patches depend on patches recently added to the vfs tree. I would
prefer these land in that tree too with an Acked-by or similar from AFS
maintainers.
Thanks,
NeilBrown
[PATCH v2 1/5] afs: don't unhash/rehash dentries during unlink/rename
[PATCH v2 2/5] afs: use d_splice_alias() in afs_vnode_new_inode()
[PATCH v2 3/5] afs: use d_alloc_trylock in afs_sillyrename()
[PATCH v2 4/5] afs: lookup_atsys to drop and reclaim lock.
[PATCH v2 5/5] afs: use d_duplicate()
More information about the linux-afs
mailing list