From: NeilBrown <neilb@ownmail.net>
To: Ilya Dryomov <idryomov@gmail.com>,
Alex Markuze <amarkuze@redhat.com>,
Viacheslav Dubeyko <slava@dubeyko.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>
Cc: Jeff Layton <jlayton@kernel.org>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] cephfs: prepare for changes to VFS locking
Date: Tue, 29 Sep 2026 12:47:38 +1000 [thread overview]
Message-ID: <20260929025331.1436824-1-neilb@ownmail.net> (raw)
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()
next reply other threads:[~2026-09-29 2:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 2:47 NeilBrown [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260929025331.1436824-1-neilb@ownmail.net \
--to=neilb@ownmail.net \
--cc=amarkuze@redhat.com \
--cc=brauner@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.com \
--cc=jack@suse.cz \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neil@brown.name \
--cc=slava@dubeyko.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox