Whamcloud - gitweb
LU-11647 ptlrpc: always unregister bulk 78/22378/6
authorHongchao Zhang <hongchao@whamcloud.com>
Thu, 15 Nov 2018 16:21:15 +0000 (11:21 -0500)
committerOleg Drokin <green@whamcloud.com>
Wed, 16 Jan 2019 07:06:41 +0000 (07:06 +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>
Reviewed-on: https://review.whamcloud.com/22378
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/client.c

index 828504e..0cd73d7 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);