aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/osd_client.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-06-04 14:43:32 -0500
committerAlex Elder <elder@dreamhost.com>2012-06-06 09:23:54 -0500
commitab8cb34a4b2f60281a4b18b1f1ad23bc2313d91b (patch)
treeb7e50d3d9e0e932aa07cd31d611e304b3173423f /net/ceph/osd_client.c
parentrbd: endian bug in rbd_req_cb() (diff)
downloadlinux-dev-ab8cb34a4b2f60281a4b18b1f1ad23bc2313d91b.tar.xz
linux-dev-ab8cb34a4b2f60281a4b18b1f1ad23bc2313d91b.zip
libceph: osd_client: don't drop reply reference too early
In ceph_osdc_release_request(), a reference to the r_reply message is dropped. But just after that, that same message is revoked if it was in use to receive an incoming reply. Reorder these so we are sure we hold a reference until we're actually done with the message. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r--net/ceph/osd_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index e30efbcc6388..d8b6d319499a 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -139,8 +139,6 @@ void ceph_osdc_release_request(struct kref *kref)
if (req->r_request)
ceph_msg_put(req->r_request);
- if (req->r_reply)
- ceph_msg_put(req->r_reply);
if (req->r_con_filling_msg) {
dout("release_request revoking pages %p from con %p\n",
req->r_pages, req->r_con_filling_msg);
@@ -148,6 +146,8 @@ void ceph_osdc_release_request(struct kref *kref)
req->r_reply);
ceph_con_put(req->r_con_filling_msg);
}
+ if (req->r_reply)
+ ceph_msg_put(req->r_reply);
if (req->r_own_pages)
ceph_release_page_vector(req->r_pages,
req->r_num_pages);