Whamcloud - gitweb
don't try dump ldlm lock buffer for llog cancel requests
authorshadow <shadow>
Thu, 1 Oct 2009 04:24:28 +0000 (04:24 +0000)
committershadow <shadow>
Thu, 1 Oct 2009 04:24:28 +0000 (04:24 +0000)
and avoid error
LustreError: 2505:0:(layout.c:1469:__req_capsule_get()) @@@ Wrong buffer for field `dlm_req' (1 of 2) in format `LDLM_CALLBACK': 32 vs. 104 (client)

Branch HEAD
b=20349
i=rread

lustre/ldlm/ldlm_lockd.c

index 26dfc80..30b251e 100644 (file)
@@ -1937,11 +1937,14 @@ static int ldlm_cancel_handler(struct ptlrpc_request *req)
                        libcfs_id2str(req->rq_peer),
                        lustre_msg_get_handle(req->rq_reqmsg)->cookie);
 
-                req_capsule_set(&req->rq_pill, &RQF_LDLM_CALLBACK);
-                dlm_req = req_capsule_client_get(&req->rq_pill, &RMF_DLM_REQ);
-                if (dlm_req != NULL)
-                        ldlm_lock_dump_handle(D_ERROR,
-                                              &dlm_req->lock_handle[0]);
+                if (lustre_msg_get_opc(req->rq_reqmsg) == LDLM_CANCEL) {
+                        req_capsule_set(&req->rq_pill, &RQF_LDLM_CALLBACK);
+                        dlm_req = req_capsule_client_get(&req->rq_pill,
+                                                         &RMF_DLM_REQ);
+                        if (dlm_req != NULL)
+                                ldlm_lock_dump_handle(D_ERROR,
+                                                      &dlm_req->lock_handle[0]);
+                }
                 ldlm_callback_reply(req, -ENOTCONN);
                 RETURN(0);
         }