libceph: osd_client: don't drop reply reference too early
authorAlex Elder <elder@inktank.com>
Mon, 4 Jun 2012 19:43:32 +0000 (14:43 -0500)
committerAlex Elder <elder@inktank.com>
Wed, 20 Jun 2012 12:43:48 +0000 (07:43 -0500)
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>
(cherry picked from commit ab8cb34a4b2f60281a4b18b1f1ad23bc2313d91b)

net/ceph/osd_client.c

index 1ffebed5ce0f9a629ad2733349b8e33c326850d5..13538da41dd6c79732ce2d3219b3abae5b216d0b 100644 (file)
@@ -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);