From 21c53b18a1bc0e36d2ecd1fb731f0dc6403902ee Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Thu, 15 Nov 2018 11:21:15 -0500 Subject: [PATCH] LU-11647 ptlrpc: always unregister bulk In ptlrpc_check_set, the bulk should be unregistered before ptl_send_rpc in any case. Change-Id: Icf963002f934b43ccbb9d6ef02ba7f9d11f297f8 Signed-off-by: Hongchao Zhang Reviewed-on: https://review.whamcloud.com/22378 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- lustre/ptlrpc/client.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 828504e..0cd73d7 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -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); -- 1.8.3.1