Whamcloud - gitweb
LU-2942 ptlrpc: Fix an unswabbed status check in after_reply()
authorLi Wei <wei.g.li@intel.com>
Mon, 11 Mar 2013 07:18:49 +0000 (15:18 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 13 Mar 2013 06:13:50 +0000 (02:13 -0400)
The -EINPROGRESS handling in after_reply() checks reply status while
pb_status still contains unswabbed data.  This patch moves the block
below the unpack_reply() call.

Change-Id: I619b26d213708b8f5c250cdf085f359bba31ffae
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/5667
Tested-by: Hudson
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/ptlrpc/client.c

index 4dea902..eddd66b 100644 (file)
@@ -1223,6 +1223,16 @@ static int after_reply(struct ptlrpc_request *req)
                 RETURN(rc);
         }
 
+       /*
+        * Security layer unwrap might ask resend this request.
+        */
+       if (req->rq_resend)
+               RETURN(0);
+
+       rc = unpack_reply(req);
+       if (rc)
+               RETURN(rc);
+
        /* retry indefinitely on EINPROGRESS */
        if (lustre_msg_get_status(req->rq_repmsg) == -EINPROGRESS &&
            ptlrpc_no_resend(req) == 0 && !req->rq_no_retry_einprogress) {
@@ -1251,17 +1261,9 @@ static int after_reply(struct ptlrpc_request *req)
                        req->rq_sent = now + req->rq_timeout;
                else
                        req->rq_sent = now + req->rq_nr_resend;
-       }
 
-        /*
-         * Security layer unwrap might ask resend this request.
-         */
-        if (req->rq_resend)
-                RETURN(0);
-
-        rc = unpack_reply(req);
-        if (rc)
-                RETURN(rc);
+               RETURN(0);
+       }
 
         cfs_gettimeofday(&work_start);
         timediff = cfs_timeval_sub(&work_start, &req->rq_arrival_time, NULL);