Whamcloud - gitweb
LU-6808 ptlrpc: properly set "rq_xid" for 4MB IO
[fs/lustre-release.git] / lustre / ptlrpc / client.c
index 53a8603..59f4cc5 100644 (file)
@@ -3249,8 +3249,7 @@ void ptlrpc_set_bulk_mbits(struct ptlrpc_request *req)
        } else { /* needs to generate a new matchbits for resend */
                __u64   old_mbits = req->rq_mbits;
 
-               if ((bd->bd_import->imp_connect_data.ocd_connect_flags &
-                   OBD_CONNECT_BULK_MBITS) != 0) {
+               if (OCD_HAS_FLAG(&bd->bd_import->imp_connect_data, BULK_MBITS)){
                        req->rq_mbits = ptlrpc_next_xid();
                } else {/* old version transfers rq_xid to peer as matchbits */
                        spin_lock(&req->rq_import->imp_lock);
@@ -3268,6 +3267,11 @@ void ptlrpc_set_bulk_mbits(struct ptlrpc_request *req)
         * see LU-1431 */
        req->rq_mbits += ((bd->bd_iov_count + LNET_MAX_IOV - 1) /
                          LNET_MAX_IOV) - 1;
+
+       /* Set rq_xid as rq_mbits to indicate the final bulk for the old
+        * server which does not support OBD_CONNECT_BULK_MBITS. LU-6808 */
+       if (!OCD_HAS_FLAG(&bd->bd_import->imp_connect_data, BULK_MBITS))
+               req->rq_xid = req->rq_mbits;
 }
 
 /**