Skip to content

Commit 803cc77

Browse files
Al Virogregkh
Al Viro
authored andcommitted
ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock
[ Upstream commit dc32464 ] Use of dget() after we'd dropped ->d_lock is too late - dentry might be gone by that point. Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Al Viro <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9eab500 commit 803cc77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ceph/mds_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,8 @@ int ceph_wait_on_conflict_unlink(struct dentry *dentry)
709709
if (!d_same_name(udentry, pdentry, &dname))
710710
goto next;
711711

712+
found = dget_dlock(udentry);
712713
spin_unlock(&udentry->d_lock);
713-
found = dget(udentry);
714714
break;
715715
next:
716716
spin_unlock(&udentry->d_lock);

0 commit comments

Comments
 (0)