ceph: fix unsafe dcache access in ceph_encode_dentry_release
authorJeff Layton <jlayton@redhat.com>
Thu, 15 Dec 2016 13:37:58 +0000 (08:37 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 20 Feb 2017 11:16:05 +0000 (12:16 +0100)
commitadf0d68701c7f3e50f21308c76f41e60956a6832
tree82927817ebd1d9d064a2278d42f8b999b2ac7fe4
parentfd36a71762f3b0fcb9741ed24021afabec7e0c45
ceph: fix unsafe dcache access in ceph_encode_dentry_release

Accessing d_parent requires some sort of locking or it could vanish
out from under us. Since we take the d_lock anyway, use that to fetch
d_parent and take a reference to it, and then use that reference to
call ceph_encode_inode_release.

Link: http://tracker.ceph.com/issues/18148
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c