summaryrefslogtreecommitdiffstats
path: root/fs/ceph/osd_client.c
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2009-12-15 09:50:36 -0800
committerSage Weil <sage@newdream.net>2009-12-21 16:39:51 -0800
commit93c20d98c29ccefa039c3843ccc37122caaf3d31 (patch)
treeed434cc0f9390c2821051979ae1237dd25f97217 /fs/ceph/osd_client.c
parentb3d1dbbdd5670d8a9fb01f7dfb1cac522ff6795a (diff)
downloadop-kernel-dev-93c20d98c29ccefa039c3843ccc37122caaf3d31.zip
op-kernel-dev-93c20d98c29ccefa039c3843ccc37122caaf3d31.tar.gz
ceph: fix msgpool reservation leak
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Diffstat (limited to 'fs/ceph/osd_client.c')
-rw-r--r--fs/ceph/osd_client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c
index 67ef8ab..63482ef 100644
--- a/fs/ceph/osd_client.c
+++ b/fs/ceph/osd_client.c
@@ -145,6 +145,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
ceph_osdc_put_request(req);
return ERR_PTR(-ENOMEM);
}
+ req->r_num_prealloc_reply = num_reply;
req->r_osdc = osdc;
req->r_mempool = use_mempool;
@@ -165,7 +166,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
else
msg = ceph_msg_new(CEPH_MSG_OSD_OP, msg_size, 0, 0, NULL);
if (IS_ERR(msg)) {
- ceph_msgpool_resv(&osdc->msgpool_op_reply, num_reply);
+ ceph_msgpool_resv(&osdc->msgpool_op_reply, -num_reply);
ceph_osdc_put_request(req);
return ERR_PTR(PTR_ERR(msg));
}
@@ -465,6 +466,8 @@ static void __unregister_request(struct ceph_osd_client *osdc,
rb_erase(&req->r_node, &osdc->requests);
osdc->num_requests--;
+ ceph_msgpool_resv(&osdc->msgpool_op_reply, -req->r_num_prealloc_reply);
+
if (req->r_osd) {
/* make sure the original request isn't in flight. */
ceph_con_revoke(&req->r_osd->o_con, req->r_request);
OpenPOWER on IntegriCloud