From: Andreas Dilger Date: Fri, 5 Apr 2024 22:42:48 +0000 (+0000) Subject: LU-17704 revert: "LU-17379 ptlrpc: fix check for callback discard" X-Git-Tag: 2.15.64~224 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=394de8d90668c0110257e5cfceca50d9838d606d;p=fs%2Flustre-release.git LU-17704 revert: "LU-17379 ptlrpc: fix check for callback discard" This reverts commit a6886dba0ed8a622c9831cd33d310d933492c72d. This is failing dbench intermittently in sanity-benchmark. Change-Id: Id3720c79ca8dd9276e086aab5d3fcfe43ddd680a Signed-off-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54686 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Mikhail Pershin Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin Reviewed-by: Alex Zhuravlev Reviewed-by: Stephane Thiell --- diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 762556e..81f6b97 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -2476,8 +2476,10 @@ ptlrpc_client_recv(struct ptlrpc_request *req) return req->rq_receiving_reply; } +#define ptlrpc_cli_wait_unlink(req) __ptlrpc_cli_wait_unlink(req, NULL) + static inline int -ptlrpc_cli_wait_unlink(struct ptlrpc_request *req) +__ptlrpc_cli_wait_unlink(struct ptlrpc_request *req, bool *discard) { int rc; @@ -2491,6 +2493,15 @@ ptlrpc_cli_wait_unlink(struct ptlrpc_request *req) return 1; } + if (discard) { + *discard = false; + if (req->rq_reply_unlinked && req->rq_req_unlinked == 0) { + *discard = true; + spin_unlock(&req->rq_lock); + return 1; /* Should call again after LNetMDUnlink */ + } + } + rc = !req->rq_req_unlinked || !req->rq_reply_unlinked || req->rq_receiving_reply; spin_unlock(&req->rq_lock); diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 06c71ea..bca26f9 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -2805,7 +2805,7 @@ EXPORT_SYMBOL(ptlrpc_req_xid); */ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) { - bool discard; + bool discard = false; /* * Might sleep. */ @@ -2820,15 +2820,11 @@ static int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) /* * Nothing left to do. */ - if (!ptlrpc_cli_wait_unlink(request)) + if (!__ptlrpc_cli_wait_unlink(request, &discard)) RETURN(1); LNetMDUnlink(request->rq_reply_md_h); - spin_lock(&request->rq_lock); - discard = request->rq_reply_unlinked && !request->rq_req_unlinked; - spin_unlock(&request->rq_lock); - if (discard) /* Discard the request-out callback */ __LNetMDUnlink(request->rq_req_md_h, discard);