Whamcloud - gitweb
LU-17704 revert: "LU-17379 ptlrpc: fix check for callback discard" 86/54686/4
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 5 Apr 2024 22:42:48 +0000 (22:42 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 21 May 2024 18:24:20 +0000 (18:24 +0000)
This reverts commit a6886dba0ed8a622c9831cd33d310d933492c72d.
This is failing dbench intermittently in sanity-benchmark.

Change-Id: Id3720c79ca8dd9276e086aab5d3fcfe43ddd680a
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54686
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Stephane Thiell <sthiell@stanford.edu>
lustre/include/lustre_net.h
lustre/ptlrpc/client.c

index 762556e..81f6b97 100644 (file)
@@ -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);
index 06c71ea..bca26f9 100644 (file)
@@ -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);