libceph: register request before unregister linger
authorAlex Elder <elder@inktank.com>
Thu, 6 Dec 2012 13:22:04 +0000 (07:22 -0600)
committerAlex Elder <elder@inktank.com>
Thu, 20 Dec 2012 16:56:39 +0000 (10:56 -0600)
In kick_requests(), we need to register the request before we
unregister the linger request.  Otherwise the unregister will
reset the request's osd pointer to NULL.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
net/ceph/osd_client.c

index 7cd0a7f3bf43086fa097e8f7596d183c0099f890..780caf6b049188cd20e043f2206b23600223b820 100644 (file)
@@ -1328,8 +1328,8 @@ static void kick_requests(struct ceph_osd_client *osdc, int force_resend)
 
                dout("kicking lingering %p tid %llu osd%d\n", req, req->r_tid,
                     req->r_osd ? req->r_osd->o_osd : -1);
-               __unregister_linger_request(osdc, req);
                __register_request(osdc, req);
+               __unregister_linger_request(osdc, req);
        }
        mutex_unlock(&osdc->request_mutex);