Whamcloud - gitweb
LU-12199 lnet: verify msg is commited for send/recv 97/34797/12
authorAmir Shehata <ashehata@whamcloud.com>
Tue, 30 Apr 2019 21:01:48 +0000 (14:01 -0700)
committerAmir Shehata <ashehata@whamcloud.com>
Fri, 7 Jun 2019 18:10:01 +0000 (18:10 +0000)
Before performing a health check make sure the message
is committed for either send or receive. Otherwise we
can just finalize it.

Test-Parameters: forbuildonly
Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Change-Id: Id7bd956f8e81e60a2d63059730973f851d4c7abe
Reviewed-on: https://review.whamcloud.com/34797
Reviewed-by: Chris Horn <hornc@cray.com>
Tested-by: Jenkins
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
lnet/lnet/lib-msg.c

index e1a8142..f785f55 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
         */