ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock
Subsystems (2)
Al Viro
maintainerPATCH 1/1 ceph_wait_on_conflict_unlink(): grab reference before dropping ->d_lock
[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 <[email protected]>
--- fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/mds_client.c +1 -1
@@ -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);
Signature · 1 line
2.39.2
Quoted 14 lines · Al Viro
[at the moment in viro/vfs.git#fixes]
Use ofdget()after we'd dropped ->d_lock is too late - dentry might be gone by that point.Signed-off-by Al Viro <[email protected]>--- fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/mds_client.c +0
-0
fs/ceph/mds_client.c int ceph_wait_on_conflict_unlink(struct dentry *dentry) · line 868
Quoted 9 lines
fs/ceph/mds_client.c +1
-1@@ -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);
Reviewed-by Jeff Layton <[email protected]>
Quoted 14 lines · Al Viro
[at the moment in viro/vfs.git#fixes]
Use ofdget()after we'd dropped ->d_lock is too late - dentry might be gone by that point.Signed-off-by Al Viro <[email protected]>--- fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/ceph/mds_client.c +0
-0
fs/ceph/mds_client.c int ceph_wait_on_conflict_unlink(struct dentry *dentry) · line 868
Quoted 9 lines
fs/ceph/mds_client.c +1
-1@@ -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