Whamcloud - gitweb
LU-8102 ldlm: Correlate ptlrpc req w/AST error 83/19983/2
authorChris Horn <hornc@cray.com>
Wed, 4 May 2016 19:13:28 +0000 (14:13 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 14 Jun 2016 03:54:03 +0000 (03:54 +0000)
Enhance AST error and debug messages with the pointer and xid of the
corresponding ptlrpc request.

Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: I47834d092df0ac8638b03aa6447b3bd772ee5e0b
Reviewed-on: http://review.whamcloud.com/19983
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lockd.c

index 37feb38..f52d572 100644 (file)
@@ -659,31 +659,33 @@ static void ldlm_failed_ast(struct ldlm_lock *lock, int rc,
  * Perform lock cleanup if AST reply came with error.
  */
 static int ldlm_handle_ast_error(struct ldlm_lock *lock,
-                                 struct ptlrpc_request *req, int rc,
-                                 const char *ast_type)
+                                struct ptlrpc_request *req, int rc,
+                                const char *ast_type)
 {
        lnet_process_id_t peer = req->rq_import->imp_connection->c_peer;
 
        if (!req->rq_replied || (rc && rc != -EINVAL)) {
                if (lock->l_export && lock->l_export->exp_libclient) {
-                       LDLM_DEBUG(lock, "%s AST to liblustre client (nid %s)"
-                                  " timeout, just cancelling lock", ast_type,
+                       LDLM_DEBUG(lock,
+                                  "%s AST (req@%p x"LPU64") to liblustre client (nid %s) timeout, just cancelling lock",
+                                  ast_type, req, req->rq_xid,
                                   libcfs_nid2str(peer.nid));
                        ldlm_lock_cancel(lock);
                        rc = -ERESTART;
                } else if (ldlm_is_cancel(lock)) {
-                       LDLM_DEBUG(lock, "%s AST timeout from nid %s, but "
-                                  "cancel was received (AST reply lost?)",
-                                  ast_type, libcfs_nid2str(peer.nid));
+                       LDLM_DEBUG(lock,
+                                  "%s AST (req@%p x"LPU64") timeout from nid %s, but cancel was received (AST reply lost?)",
+                                  ast_type, req, req->rq_xid,
+                                  libcfs_nid2str(peer.nid));
                        ldlm_lock_cancel(lock);
                        rc = -ERESTART;
                } else {
-                       LDLM_ERROR(lock, "client (nid %s) %s %s AST "
-                                  "(req status %d rc %d), evict it",
+                       LDLM_ERROR(lock,
+                                  "client (nid %s) %s %s AST (req@%p x"LPU64" status %d rc %d), evict it",
                                   libcfs_nid2str(peer.nid),
                                   req->rq_replied ? "returned error from" :
                                   "failed to reply to",
-                                  ast_type,
+                                  ast_type, req, req->rq_xid,
                                   (req->rq_repmsg != NULL) ?
                                   lustre_msg_get_status(req->rq_repmsg) : 0,
                                   rc);
@@ -695,12 +697,12 @@ static int ldlm_handle_ast_error(struct ldlm_lock *lock,
        if (rc == -EINVAL) {
                struct ldlm_resource *res = lock->l_resource;
 
-               LDLM_DEBUG(lock, "client (nid %s) returned %d"
-                          " from %s AST - normal race",
+               LDLM_DEBUG(lock,
+                          "client (nid %s) returned %d from %s AST (req@%p x"LPU64") - normal race",
                           libcfs_nid2str(peer.nid),
                           req->rq_repmsg ?
                           lustre_msg_get_status(req->rq_repmsg) : -1,
-                          ast_type);
+                          ast_type, req, req->rq_xid);
                if (res) {
                        /* update lvbo to return proper attributes.
                         * see bug 23174 */