From 002e25b9277905b97aa827dc3fb72db2f25b32f2 Mon Sep 17 00:00:00 2001 From: Olaf Weber Date: Wed, 13 Sep 2017 11:42:36 -0400 Subject: [PATCH] LU-9933 lnet: Handle ping buffer with only loopback NID 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 Change-Id: Ie5454b58f01ded17d0cff47ad5358e5d4bcebcd8 Reviewed-on: https://review.whamcloud.com/28811 Reviewed-by: James Simmons Reviewed-by: Amir Shehata Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lnet/lnet/peer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lnet/lnet/peer.c b/lnet/lnet/peer.c index d24c201..766ef83 100644 --- a/lnet/lnet/peer.c +++ b/lnet/lnet/peer.c @@ -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) -- 1.8.3.1