From: Hongchao Zhang Date: Thu, 15 Nov 2018 16:21:15 +0000 (-0500) Subject: LU-11647 ptlrpc: always unregister bulk X-Git-Tag: 2.12.1-RC1~80 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ca5c659097595daa10eae0c20a6d94294524a2d4;p=fs%2Flustre-release.git LU-11647 ptlrpc: always unregister bulk In ptlrpc_check_set, the bulk should be unregistered before ptl_send_rpc in any case. Lustre-change: https://review.whamcloud.com/22378 Lustre-commit: 21c53b18a1bc0e36d2ecd1fb731f0dc6403902ee Change-Id: Icf963002f934b43ccbb9d6ef02ba7f9d11f297f8 Signed-off-by: Hongchao Zhang Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/34305 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 1ea3b9f..402992c 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);