Whamcloud - gitweb
Update changelog for release 0_5_7
[fs/lustre-release.git] / lustre / ptlrpc / service.c
index af99b41..38bc4ab 100644 (file)
@@ -162,7 +162,7 @@ static int handle_incoming_request(struct obd_device *obddev,
         request.rq_reqlen = event->mem_desc.length;
 
         if (request.rq_reqlen < sizeof(struct lustre_msg)) {
-                CERROR("incomplete request (%d): ptl %d from %Lx xid %Ld\n",
+                CERROR("incomplete request (%d): ptl %d from "LPX64" xid "LPD64"\n",
                        request.rq_reqlen, svc->srv_req_portal,
                        event->initiator.nid, request.rq_xid);
                 spin_unlock(&svc->srv_lock);
@@ -178,7 +178,7 @@ static int handle_incoming_request(struct obd_device *obddev,
         }
 
         if (request.rq_reqmsg->magic != PTLRPC_MSG_MAGIC) {
-                CERROR("wrong lustre_msg magic %d: ptl %d from %Lx xid %Ld\n",
+                CERROR("wrong lustre_msg magic %d: ptl %d from "LPX64" xid "LPD64"\n",
                        request.rq_reqmsg->magic, svc->srv_req_portal,
                        event->initiator.nid, request.rq_xid);
                 spin_unlock(&svc->srv_lock);
@@ -186,14 +186,14 @@ static int handle_incoming_request(struct obd_device *obddev,
         }
 
         if (request.rq_reqmsg->version != PTLRPC_MSG_VERSION) {
-                CERROR("wrong lustre_msg version %d: ptl %d from %Lx xid %Ld\n",
+                CERROR("wrong lustre_msg version %d: ptl %d from "LPX64" xid "LPD64"\n",
                        request.rq_reqmsg->version, svc->srv_req_portal,
                        event->initiator.nid, request.rq_xid);
                 spin_unlock(&svc->srv_lock);
                 RETURN(-EINVAL);
         }
 
-        CDEBUG(D_NET, "got req %Ld\n", request.rq_xid);
+        CDEBUG(D_NET, "got req "LPD64"\n", request.rq_xid);
 
         request.rq_peer.peer_nid = event->initiator.nid;
         /* FIXME: this NI should be the incoming NI.
@@ -345,25 +345,30 @@ int ptlrpc_unregister_service(struct ptlrpc_service *service)
 {
         int rc, i;
 
-        for (i = 0; i < service->srv_nbuffs; i++) {
-                struct ptlrpc_request_buffer_desc *rqbd =&service->srv_rqbds[i];
+        /* NB service->srv_nbuffs gets set before we attempt (and possibly
+         * fail) to allocate srv_rqbds.
+         */
+        if (service->srv_rqbds != NULL) {
+                for (i = 0; i < service->srv_nbuffs; i++) {
+                        struct ptlrpc_request_buffer_desc *rqbd =
+                                &service->srv_rqbds[i];
 
-                if (rqbd->rqbd_buffer == NULL) /* no buffer allocated */
-                        continue;             /* => never initialised */
+                        if (rqbd->rqbd_buffer == NULL) /* no buffer allocated */
+                                continue;             /* => never initialised */
 
-                /* Buffer allocated => got linked */
-                LASSERT (ptl_is_valid_handle (&rqbd->rqbd_me_h));
+                        /* Buffer allocated => got linked */
+                        LASSERT (ptl_is_valid_handle (&rqbd->rqbd_me_h));
 
-                rc = PtlMEUnlink(rqbd->rqbd_me_h);
-                if (rc)
-                        CERROR("PtlMEUnlink failed: %d\n", rc);
+                        rc = PtlMEUnlink(rqbd->rqbd_me_h);
+                        if (rc)
+                                CERROR("PtlMEUnlink failed: %d\n", rc);
 
-                OBD_FREE(rqbd->rqbd_buffer, service->srv_buf_size);
-        }
+                        OBD_FREE(rqbd->rqbd_buffer, service->srv_buf_size);
+                }
 
-        if (service->srv_rqbds != NULL)
                 OBD_FREE(service->srv_rqbds, service->srv_nbuffs *
                          sizeof (struct ptlrpc_request_buffer_desc));
+        }
 
         rc = PtlEQFree(service->srv_eq_h);
         if (rc)