Whamcloud - gitweb
LU-8193 ptlrpc: set proper mbits for EINPROGRESS resend 77/20377/2
authorNiu Yawei <yawei.niu@intel.com>
Mon, 23 May 2016 05:49:26 +0000 (01:49 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 31 May 2016 04:55:08 +0000 (04:55 +0000)
Set mbits for EINPROGRESS resend in ptl_send_rpc().

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: If9db4a67530371ce5c2504c60ea79f9c9db6ce15
Reviewed-on: http://review.whamcloud.com/20377
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Liang Zhen <liang.zhen@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ptlrpc/client.c
lustre/ptlrpc/niobuf.c

index c9f293c..ecb2384 100644 (file)
@@ -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 &
                __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();
                        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);
        }
                CDEBUG(D_HA, "resend bulk old x"LPU64" new x"LPU64"\n",
                       old_mbits, req->rq_mbits);
        }
index 907ab28..e7a694a 100644 (file)
@@ -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);
                 * 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");
                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);
        }
                ptlrpc_set_bulk_mbits(request);
                lustre_msg_set_mbits(request->rq_reqmsg, request->rq_mbits);
        }