Skip to content

cephfs: prepare for changes to VFS locking

NeilBrown ceph-devel linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cephfs: Use d_alloc_trylock() in ceph_readdir_prepopulate()fs/ceph/inode.c+17 -210 replies
2/3cephfs: Don't d_drop() before d_splice_alias()fs/ceph/file.c fs/ceph/inode.c+0 -50 replies
3/3cephfs: stop using d_add()fs/ceph/dir.c fs/ceph/inode.c+3 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] cephfs: prepare for changes to VFS locking

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()