mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] cephfs: prepare for changes to VFS locking
@ 2026-09-29  2:47 NeilBrown
  2026-09-29  2:47 ` [PATCH 1/3] cephfs: Use d_alloc_trylock() in ceph_readdir_prepopulate() NeilBrown
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: NeilBrown @ 2026-09-29  2:47 UTC (permalink / raw)
  To: Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Alexander Viro,
	Christian Brauner
  Cc: Jeff Layton, Jan Kara, linux-fsdevel, ceph-devel, linux-kernel

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 3/3 isn't strictly needed here but I'd like to deprecate d_add()
in favour of d_splice_alias() as the latter now does everything the
former can do.  So the last patch removes uses of d_add() from fs/ceph.

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 cifs
maintainers.

Thanks,
NeilBrown

 [PATCH 1/3] cephfs: Use d_alloc_trylock() in
 [PATCH 2/3] cephfs: Don't d_drop() before d_splice_alias()
 [PATCH 3/3] cephfs: stop using d_add()

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

end of thread, other threads:[~2026-09-29  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29  2:47 [PATCH 0/3] cephfs: prepare for changes to VFS locking NeilBrown
2026-09-29  2:47 ` [PATCH 1/3] cephfs: Use d_alloc_trylock() in ceph_readdir_prepopulate() NeilBrown
2026-09-29  2:47 ` [PATCH 2/3] cephfs: Don't d_drop() before d_splice_alias() NeilBrown
2026-09-29  2:47 ` [PATCH 3/3] cephfs: stop using d_add() NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®