Whamcloud - gitweb
branch: HEAD
authorericm <ericm>
Wed, 3 Sep 2008 19:21:38 +0000 (19:21 +0000)
committerericm <ericm>
Wed, 3 Sep 2008 19:21:38 +0000 (19:21 +0000)
don't expire request which is waiting for security context.
b=16315
r=wangdi
r=umka

lustre/ptlrpc/client.c
lustre/ptlrpc/niobuf.c

index 6c794b8..704f66f 100644 (file)
@@ -1095,8 +1095,6 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req)
                         req->rq_status = rc;
                         RETURN(1);
                 } else {
-                        /* here begins timeout counting */
-                        req->rq_sent = cfs_time_current_sec();
                         req->rq_wait_ctx = 1;
                         RETURN(0);
                 }
@@ -1197,12 +1195,6 @@ int ptlrpc_check_set(struct ptlrpc_request_set *set)
                             req->rq_waiting || req->rq_wait_ctx) {
                                 int status;
 
-                                /* rq_wait_ctx is only touched in ptlrpcd,
-                                 * no lock needed here.
-                                 */
-                                if (req->rq_wait_ctx)
-                                        goto check_ctx;
-
                                 ptlrpc_unregister_reply(req);
 
                                 spin_lock(&imp->imp_lock);
@@ -1247,21 +1239,21 @@ int ptlrpc_check_set(struct ptlrpc_request_set *set)
                                                        old_xid, req->rq_xid);
                                         }
                                 }
-check_ctx:
+                                /*
+                                 * rq_wait_ctx is only touched by ptlrpcd,
+                                 * so no lock is needed here.
+                                 */
                                 status = sptlrpc_req_refresh_ctx(req, -1);
                                 if (status) {
                                         if (req->rq_err) {
                                                 req->rq_status = status;
                                                 force_timer_recalc = 1;
-                                        }
-                                        if (!req->rq_wait_ctx) {
-                                                /* begins timeout counting */
-                                                req->rq_sent = cfs_time_current_sec();
+                                        } else {
                                                 req->rq_wait_ctx = 1;
                                         }
+
                                         continue;
                                 } else {
-                                        req->rq_sent = 0;
                                         req->rq_wait_ctx = 0;
                                 }
 
@@ -1402,7 +1394,6 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req)
 
         spin_lock(&req->rq_lock);
         req->rq_timedout = 1;
-        req->rq_wait_ctx = 0;
         spin_unlock(&req->rq_lock);
 
         ptlrpc_unregister_reply (req);
@@ -1534,6 +1525,9 @@ int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
                 if (req->rq_timedout)   /* already timed out */
                         continue;
 
+                if (req->rq_wait_ctx)   /* waiting for ctx */
+                        continue;
+
                 if (req->rq_phase == RQ_PHASE_NEW)
                         deadline = req->rq_sent;
                 else
index 3ca88b7..6d4226d 100644 (file)
@@ -477,7 +477,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
         if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_DROP_RPC))
                 RETURN(0);
 
-        LASSERT (request->rq_type == PTL_RPC_MSG_REQUEST);
+        LASSERT(request->rq_type == PTL_RPC_MSG_REQUEST);
+        LASSERT(request->rq_wait_ctx == 0);
 
         /* If this is a re-transmit, we're required to have disengaged
          * cleanly from the previous attempt */