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>
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;
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.