[PATCH v2 0/2] cephfs: prepare for changes to VFS locking

From: NeilBrown

Date: Mon Nov 09 2026 - 15:27:04 EST


This v2 drops 3/3 which was deprecating d_add() - there is no rush for
that so I'm not going to push it at present.
It also fixes the first patch to increment "skipped" when d_alloc_trylock()
returns -EWOULDBLOCK.

The VFS patches that this series depends on are upstream, so this can
land in any tree.

Thanks,
NeilBrown

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/ that d_alloc_parallel() not be called while i_rwsem is held and also
that d_alloc()/d_splice_alias() not be used (unless the filesystems
doesn't support creating objects).
cephfs uses d_alloc()/d_splice_alias() when priming the dcache from
the results of readdir. A new interface d_alloc_trylock()
is now available and can be used instead.

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. cephfs calls d_drop() in couple of places
before d_splice_alias() but this is no longer needed as d_splice_alias()
handles spliced aliases now.


[PATCH v2 1/2] cephfs: Use d_alloc_trylock() in
[PATCH v2 2/2] cephfs: Don't d_drop() before d_splice_alias()