[lustre-devel] [PATCH 367/622] lnet: Do not allow gateways on remote nets

James Simmons jsimmons at infradead.org
Thu Feb 27 13:13:55 PST 2020


From: Chris Horn <hornc at cray.com>

A gateway needs to be reachable over some local interface.

WC-bug-id: https://jira.whamcloud.com/browse/LU-12411
Lustre-commit: 43b35351e9ca ("LU-12411 lnet: Do not allow gateways on remote nets")
Signed-off-by: Chris Horn <hornc at cray.com>
Reviewed-on: https://review.whamcloud.com/35198
Reviewed-by: Amir Shehata <ashehata at whamcloud.com>
Reviewed-by: Sonia Sharma <sharmaso at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 net/lnet/lnet/router.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c
index 81f7a94..f7b53e0 100644
--- a/net/lnet/lnet/router.c
+++ b/net/lnet/lnet/router.c
@@ -436,6 +436,13 @@ static void lnet_shuffle_seed(void)
 	if (lnet_islocalnet(net))
 		return -EEXIST;
 
+	if (!lnet_islocalnet(LNET_NIDNET(gateway))) {
+		CERROR("Cannot add route with gateway %s. There is no local interface configured on LNet %s\n",
+		       libcfs_nid2str(gateway),
+		       libcfs_net2str(LNET_NIDNET(gateway)));
+		return -EINVAL;
+	}
+
 	/* Assume net, route, all new */
 	route = kzalloc(sizeof(*route), GFP_NOFS);
 	rnet = kzalloc(sizeof(*rnet), GFP_NOFS);
-- 
1.8.3.1



More information about the lustre-devel mailing list