Whamcloud - gitweb
LU-9933 lnet: Handle ping buffer with only loopback NID 11/28811/3
authorOlaf Weber <olaf.weber@hpe.com>
Wed, 13 Sep 2017 15:42:36 +0000 (11:42 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 30 Sep 2017 04:40:46 +0000 (04:40 +0000)
During startup lnet_peer_data_resent() can see a ping buffer
for the local node which contains only the loopback NID. This
shows up as pi_nnis == 1, and there is nothing to be done (or
that needs to be done) in that case.

Signed-off-by: Olaf Weber <olaf.weber@hpe.com>
Change-Id: Ie5454b58f01ded17d0cff47ad5358e5d4bcebcd8
Reviewed-on: https://review.whamcloud.com/28811
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/lnet/peer.c

index d24c201..766ef83 100644 (file)
@@ -2592,10 +2592,12 @@ __must_hold(&lp->lp_lock)
         *
         * The peer for the loopback interface is a special case: this
         * is the peer for the local node, and we want to set its
-        * primary NID to the correct value here.
+        * primary NID to the correct value here. Moreover, this peer
+        * can show up with only the loopback NID in the ping buffer.
         */
-       if (pbuf->pb_info.pi_nnis > 1)
-               nid = pbuf->pb_info.pi_ni[1].ns_nid;
+       if (pbuf->pb_info.pi_nnis <= 1)
+               goto out;
+       nid = pbuf->pb_info.pi_ni[1].ns_nid;
        if (LNET_NETTYP(LNET_NIDNET(lp->lp_primary_nid)) == LOLND) {
                rc = lnet_peer_set_primary_nid(lp, nid, flags);
                if (!rc)