[032/151] lnet: rediscover peer if it changed
diff mbox series

Message ID 1569869810-23848-33-git-send-email-jsimmons@infradead.org
State New
Headers show
  • lustre: update to 2.11 support
Related show

Commit Message

James Simmons Sept. 30, 2019, 6:54 p.m. UTC
From: Amir Shehata <ashehata@whamcloud.com>

If the peer has changed after we unlocked the cpt then
we'll need to discover the new peer.

WC-bug-id: https://jira.whamcloud.com/browse/LU-9917
Lustre-commit: 1fc4ed3ac40a ("LU-9917 lnet: rediscover peer if it changed")
Signed-off-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/28772
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
 net/lnet/lnet/peer.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff mbox series

diff --git a/net/lnet/lnet/peer.c b/net/lnet/lnet/peer.c
index ade7f23..34e61f8 100644
--- a/net/lnet/lnet/peer.c
+++ b/net/lnet/lnet/peer.c
@@ -2034,6 +2034,13 @@  static void lnet_peer_clear_discovery_error(struct lnet_peer *lp)
+	/* If the peer has changed after we've discovered the older peer,
+	 * then we need to discovery the new peer to make sure the
+	 * interface information is up to date
+	 */
+	if (lp != lpni->lpni_peer_net->lpn_peer)
+		goto again;
 	if (signal_pending(current))
 		rc = -EINTR;
 	else if (the_lnet.ln_dc_state != LNET_DC_STATE_RUNNING)