Skip to content

Commit

Permalink
ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro committed Oct 28, 2023
1 parent 1939316 commit dc32464
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dc32464

Please sign in to comment.