From fde36b52debe436dd963c5a08aa7f047edd914df Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Fri, 30 Nov 2012 15:16:41 +0100 Subject: [PATCH] LU-2371 ptlrpc: get new xid for resend on EINPROGRESS 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 Change-Id: Id423142e4440952777b74a834e2b4fa38c338280 Reviewed-on: http://review.whamcloud.com/4719 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Andreas Dilger Reviewed-by: Fan Yong --- lustre/mdc/mdc_reint.c | 4 ++++ lustre/ptlrpc/client.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/lustre/mdc/mdc_reint.c b/lustre/mdc/mdc_reint.c index 994aac6..f90a473 100644 --- a/lustre/mdc/mdc_reint.c +++ b/lustre/mdc/mdc_reint.c @@ -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; diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index eea2337..efae3ee 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -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. -- 1.8.3.1