summaryrefslogtreecommitdiff
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-03-28 21:22:50 -0700
committerSage Weil <sage@newdream.net>2010-03-28 21:23:56 -0700
commit94aa8ae13db2ecf2ec1b4e65a65d3fe92b468e0e (patch)
tree07ab734202675a9ff3bb991d9732a392061eacee /fs/ceph/mds_client.c
parent23ab15ad7a9d042afa7303b735b6e24faa607241 (diff)
downloadlwn-94aa8ae13db2ecf2ec1b4e65a65d3fe92b468e0e.tar.gz
lwn-94aa8ae13db2ecf2ec1b4e65a65d3fe92b468e0e.zip
ceph: fix use after free on mds __unregister_request
There was a use after free in __unregister_request that would trigger whenever the request map held the last reference. This appears to have triggered an oops during 'umount -f' when requests are being torn down. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 5268d404963c..5c7920be6420 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -532,7 +532,6 @@ static void __unregister_request(struct ceph_mds_client *mdsc,
dout("__unregister_request %p tid %lld\n", req, req->r_tid);
rb_erase(&req->r_node, &mdsc->request_tree);
RB_CLEAR_NODE(&req->r_node);
- ceph_mdsc_put_request(req);
if (req->r_unsafe_dir) {
struct ceph_inode_info *ci = ceph_inode(req->r_unsafe_dir);
@@ -541,6 +540,8 @@ static void __unregister_request(struct ceph_mds_client *mdsc,
list_del_init(&req->r_unsafe_dir_item);
spin_unlock(&ci->i_unsafe_lock);
}
+
+ ceph_mdsc_put_request(req);
}
/*