Whamcloud - gitweb
LU-12199 lnet: verify msg is commited for send/recv 39/36039/3
authorAmir Shehata <ashehata@whamcloud.com>
Tue, 30 Apr 2019 21:01:48 +0000 (14:01 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Oct 2019 20:31:04 +0000 (20:31 +0000)
Before performing a health check make sure the message
is committed for either send or receive. Otherwise we
can just finalize it.

Lustre-change: https://review.whamcloud.com/34797
Lustre-commit: fc6b321036f34c00d5b32b49c817dc0034fbad9e

Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: Id7bd956f8e81e60a2d63059730973f851d4c7abe
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36039
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/lib-msg.c

index 1249783..6038a71 100644 (file)
@@ -793,6 +793,20 @@ lnet_is_health_check(struct lnet_msg *msg)
        bool hc;
        int status = msg->msg_ev.status;
 
+       if ((!msg->msg_tx_committed && !msg->msg_rx_committed) ||
+           !msg->msg_onactivelist) {
+               CDEBUG(D_NET, "msg %p not committed for send or receive\n",
+                      msg);
+               return false;
+       }
+
+       if ((msg->msg_tx_committed && !msg->msg_txpeer) ||
+           (msg->msg_rx_committed && !msg->msg_rxpeer)) {
+               CDEBUG(D_NET, "msg %p failed too early to retry and send\n",
+                      msg);
+               return false;
+       }
+
        /*
         * perform a health check for any message committed for transmit
         */