From: Niu Yawei Date: Mon, 23 May 2016 05:49:26 +0000 (-0400) Subject: LU-8193 ptlrpc: set proper mbits for EINPROGRESS resend X-Git-Tag: 2.8.54~30 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=12daa707eada5dd8ca1280b133ff52d13daf4522;ds=sidebyside LU-8193 ptlrpc: set proper mbits for EINPROGRESS resend Set mbits for EINPROGRESS resend in ptl_send_rpc(). Signed-off-by: Niu Yawei Change-Id: If9db4a67530371ce5c2504c60ea79f9c9db6ce15 Reviewed-on: http://review.whamcloud.com/20377 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Liang Zhen Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index c9f293c..ecb2384 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -3207,11 +3207,15 @@ void ptlrpc_set_bulk_mbits(struct ptlrpc_request *req) __u64 old_mbits = req->rq_mbits; if ((bd->bd_import->imp_connect_data.ocd_connect_flags & - OBD_CONNECT_BULK_MBITS) != 0) + OBD_CONNECT_BULK_MBITS) != 0) { req->rq_mbits = ptlrpc_next_xid(); - else /* old version transfers rq_xid to peer as matchbits */ - req->rq_mbits = req->rq_xid = ptlrpc_next_xid(); - + } else {/* old version transfers rq_xid to peer as matchbits */ + spin_lock(&req->rq_import->imp_lock); + list_del_init(&req->rq_unreplied_list); + ptlrpc_assign_next_xid_nolock(req); + req->rq_mbits = req->rq_xid; + spin_unlock(&req->rq_import->imp_lock); + } CDEBUG(D_HA, "resend bulk old x"LPU64" new x"LPU64"\n", old_mbits, req->rq_mbits); } diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 907ab28..e7a694a 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -712,14 +712,15 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply) * reconstruction */ spin_lock(&imp->imp_lock); ptlrpc_assign_next_xid_nolock(request); - request->rq_mbits = request->rq_xid; min_xid = ptlrpc_known_replied_xid(imp); spin_unlock(&imp->imp_lock); lustre_msg_set_last_xid(request->rq_reqmsg, min_xid); DEBUG_REQ(D_RPCTRACE, request, "Allocating new xid for " "resend on EINPROGRESS"); - } else if (request->rq_bulk != NULL) { + } + + if (request->rq_bulk != NULL) { ptlrpc_set_bulk_mbits(request); lustre_msg_set_mbits(request->rq_reqmsg, request->rq_mbits); }