Whamcloud - gitweb
don't resend llog cancels,
authorshadow <shadow>
Wed, 3 Dec 2008 04:21:35 +0000 (04:21 +0000)
committershadow <shadow>
Wed, 3 Dec 2008 04:21:35 +0000 (04:21 +0000)
fix resend requests for ldlm imports.

Branch b1_8_gate
b=17695
i=umka
i=tappro

lustre/ptlrpc/client.c

index bf3d4c5..0d4c0a9 100644 (file)
@@ -1099,7 +1099,7 @@ int ptlrpc_check_set(struct ptlrpc_request_set *set)
                         if (ptlrpc_client_recv_or_unlink(req) ||
                             ptlrpc_client_bulk_active(req))
                                 continue;
-                        
+
                         /* Turn repl fail_loc off to prevent it from looping
                          * forever. */
                         if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_REPL_UNLINK)) {
@@ -1127,7 +1127,7 @@ int ptlrpc_check_set(struct ptlrpc_request_set *set)
                 /* Note that this also will start async reply unlink */
                 if (req->rq_net_err && !req->rq_timedout) {
                         ptlrpc_expire_one_request(req, 1);
-                        
+
                         /* Check if we still need to wait for unlink. */
                         if (ptlrpc_client_recv_or_unlink(req) ||
                             ptlrpc_client_bulk_active(req))
@@ -1160,8 +1160,11 @@ int ptlrpc_check_set(struct ptlrpc_request_set *set)
                                         continue;
 
                                 spin_lock(&imp->imp_lock);
-
                                 if (ptlrpc_import_delay_req(imp, req, &status)){
+                                        /* put on delay list - only if we wait
+                                         * recovery finished - before send */
+                                        list_del_init(&req->rq_list);
+                                        list_add_tail(&req->rq_list, &imp->imp_delayed_list);
                                         spin_unlock(&imp->imp_lock);
                                         continue;
                                 }
@@ -1193,8 +1196,6 @@ int ptlrpc_check_set(struct ptlrpc_request_set *set)
                                         /* This is re-sending anyways, 
                                          * let's mark req as resend. */
                                         req->rq_resend = 1;
-                                        lustre_msg_add_flags(req->rq_reqmsg,
-                                                             MSG_RESENT);
                                         if (req->rq_bulk) {
                                                 __u64 old_xid;
 
@@ -1245,17 +1246,8 @@ int ptlrpc_check_set(struct ptlrpc_request_set *set)
                         spin_unlock(&req->rq_lock);
 
                         req->rq_status = after_reply(req);
-                        if (req->rq_resend) {
-                                /* Add this req to the delayed list so
-                                   it can be errored if the import is
-                                   evicted after recovery. */
-                                spin_lock(&imp->imp_lock);
-                                list_del_init(&req->rq_list);
-                                list_add_tail(&req->rq_list,
-                                              &imp->imp_delayed_list);
-                                spin_unlock(&imp->imp_lock);
+                        if (req->rq_resend)
                                 continue;
-                        }
 
                         /* If there is no bulk associated with this request,
                          * then we're done and should let the interpreter
@@ -2004,8 +1996,6 @@ restart:
         }
 
         if (req->rq_resend) {
-                lustre_msg_add_flags(req->rq_reqmsg, MSG_RESENT);
-
                 if (req->rq_bulk != NULL) {
                         ptlrpc_unregister_bulk(req, 0);
 
@@ -2083,18 +2073,18 @@ restart:
         }
 
         /* Resend if we need to */
-        if (req->rq_resend) {
+        if (req->rq_resend||req->rq_timedout) {
                 /* ...unless we were specifically told otherwise. */
                 if (req->rq_no_resend)
                         GOTO(out, rc = -ETIMEDOUT);
                 spin_lock(&imp->imp_lock);
+                /* we can have rq_timeout on dlm fake import which not support
+                 * recovery - but me need resend request on this import instead
+                 * of return error */
+                req->rq_resend = 1;
                 goto restart;
         }
 
-        if (req->rq_timedout) {                 /* non-recoverable timeout */
-                GOTO(out, rc = -ETIMEDOUT);
-        }
-
         if (!ptlrpc_client_replied(req)) {
                 /* How can this be? -eeb */
                 DEBUG_REQ(D_ERROR, req, "!rq_replied: ");