Whamcloud - gitweb
LU-11647 ptlrpc: always unregister bulk 78/22378/5
authorHongchao Zhang <hongchao@whamcloud.com>
Thu, 15 Nov 2018 16:21:15 +0000 (11:21 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 1 Dec 2018 05:33:23 +0000 (05:33 +0000)
In ptlrpc_check_set, the bulk should be unregistered before
ptl_send_rpc in any case.

Change-Id: Icf963002f934b43ccbb9d6ef02ba7f9d11f297f8
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
lustre/ptlrpc/client.c

index 1ea3b9f..402992c 100644 (file)
@@ -1910,10 +1910,6 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                                        spin_lock(&req->rq_lock);
                                        req->rq_resend = 1;
                                        spin_unlock(&req->rq_lock);
-
-                                       if (req->rq_bulk != NULL &&
-                                           !ptlrpc_unregister_bulk(req, 1))
-                                               continue;
                                 }
                                 /*
                                  * rq_wait_ctx is only touched by ptlrpcd,
@@ -1940,6 +1936,12 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
                                        spin_unlock(&req->rq_lock);
                                }
 
+                               /* In any case, the previous bulk should be
+                                * cleaned up to prepare for the new sending */
+                               if (req->rq_bulk != NULL &&
+                                   !ptlrpc_unregister_bulk(req, 1))
+                                       continue;
+
                                rc = ptl_send_rpc(req, 0);
                                if (rc == -ENOMEM) {
                                        spin_lock(&imp->imp_lock);