mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock
[ Upstream commit dc32464a5f ]
Use of dget() after we'd dropped ->d_lock is too late - dentry might
be gone by that point.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9eab5008db
commit
803cc77a3a
@@ -709,8 +709,8 @@ int ceph_wait_on_conflict_unlink(struct dentry *dentry)
|
|||||||
if (!d_same_name(udentry, pdentry, &dname))
|
if (!d_same_name(udentry, pdentry, &dname))
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
|
found = dget_dlock(udentry);
|
||||||
spin_unlock(&udentry->d_lock);
|
spin_unlock(&udentry->d_lock);
|
||||||
found = dget(udentry);
|
|
||||||
break;
|
break;
|
||||||
next:
|
next:
|
||||||
spin_unlock(&udentry->d_lock);
|
spin_unlock(&udentry->d_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user