Re: [PATCH] ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/26/23 10:21, Al Viro wrote:
[at the moment in viro/vfs.git#fixes]
Use of dget() after we'd dropped ->d_lock is too late - dentry might
be gone by that point.

Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
---
  fs/ceph/mds_client.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 615db141b6c4..293b93182955 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -861,8 +861,8 @@ int ceph_wait_on_conflict_unlink(struct dentry *dentry)
  		if (!d_same_name(udentry, pdentry, &dname))
  			goto next;
+ found = dget_dlock(udentry);
  		spin_unlock(&udentry->d_lock);
-		found = dget(udentry);
  		break;
  next:
  		spin_unlock(&udentry->d_lock);

Good catch.

Thanks Al.

- Xiubo






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux