[PATCH 2/3] cephfs: Don't d_drop() before d_splice_alias()

From: NeilBrown

Date: Mon Sep 28 2026 - 22:57:27 EST


From: NeilBrown <neil@xxxxxxxxxx>

In two places ceph drops a dentry and then calls d_splice_alias().
The d_drop() is no longer needed before d_splice_alias() and will
cause problems for proposed changes to locking.

Signed-off-by: NeilBrown <neil@xxxxxxxxxx>
---
fs/ceph/file.c | 2 --
fs/ceph/inode.c | 3 ---
2 files changed, 5 deletions(-)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index bd3e3f5c269e..62c1b77fcd90 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -772,8 +772,6 @@ static int ceph_finish_async_create(struct inode *dir, struct inode *inode,
unlock_new_inode(inode);
}
if (d_in_lookup(dentry) || d_really_is_negative(dentry)) {
- if (!d_unhashed(dentry))
- d_drop(dentry);
dn = d_splice_alias(inode, dentry);
WARN_ON_ONCE(dn && dn != dentry);
}
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 74a107b6ef3c..01c468a509e2 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1555,9 +1555,6 @@ static int splice_dentry(struct dentry **pdn, struct inode *in)
}
}

- /* dn must be unhashed */
- if (!d_unhashed(dn))
- d_drop(dn);
realdn = d_splice_alias(in, dn);
if (IS_ERR(realdn)) {
pr_err_client(cl, "error %ld %p inode %p ino %llx.%llx\n",
--
2.50.0.107.gf914562f5916.dirty