Whamcloud - gitweb
LU-2371 ptlrpc: get new xid for resend on EINPROGRESS
authorJohann Lombardi <johann.lombardi@intel.com>
Fri, 30 Nov 2012 14:16:41 +0000 (15:16 +0100)
committerOleg Drokin <green@whamcloud.com>
Mon, 17 Dec 2012 06:41:36 +0000 (01:41 -0500)
Allocate new xid for ptlrpc resend on EINPROGRESS to avoid MDT's reply
recontruction code which will cause EINPROGRESS to always been replied
on subsequent resent.
Also fix non-intent creation path to set rq_no_retry_einprogress.

Signed-off-by: Johann Lombardi <johann.lombardi@intel.com>
Change-Id: Id423142e4440952777b74a834e2b4fa38c338280
Reviewed-on: http://review.whamcloud.com/4719
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
lustre/mdc/mdc_reint.c
lustre/ptlrpc/client.c

index 994aac6..f90a473 100644 (file)
@@ -278,6 +278,10 @@ rebuild:
 
         ptlrpc_request_set_replen(req);
 
+       /* ask ptlrpc not to resend on EINPROGRESS since we have our own retry
+        * logic here */
+       req->rq_no_retry_einprogress = 1;
+
         if (resends) {
                 req->rq_generation_set = 1;
                 req->rq_import_generation = generation;
index eea2337..efae3ee 100644 (file)
@@ -1214,6 +1214,15 @@ static int after_reply(struct ptlrpc_request *req)
                req->rq_resend = 1;
                req->rq_nr_resend++;
 
+               /* allocate new xid to avoid reply reconstruction */
+               if (!req->rq_bulk) {
+                       /* new xid is already allocated for bulk in
+                        * ptlrpc_check_set() */
+                       req->rq_xid = ptlrpc_next_xid();
+                       DEBUG_REQ(D_RPCTRACE, req, "Allocating new xid for "
+                                 "resend on EINPROGRESS");
+               }
+
                /* Readjust the timeout for current conditions */
                ptlrpc_at_set_req_timeout(req);
                /* delay resend to give a chance to the server to get ready.