diff mbox series

[419/622] lnet: Return EHOSTUNREACH for unreachable gateway

Message ID 1582838290-17243-420-git-send-email-jsimmons@infradead.org
State New, archived
Headers show
Series lustre: sync closely to 2.13.52 | expand

Commit Message

James Simmons Feb. 27, 2020, 9:14 p.m. UTC
From: Chris Horn <hornc@cray.com>

Commit f1d0660a5bbe ("lnet: Do not allow gateways on remote nets")
contains a flaw in that it shouldn't be a fatal error to
encounter an unreachable gateway when parsing routes.  Parsing should
continue in case there are any valid, reachable routes that are being
added.  Returning EINAL here will cause a failure to load the LNet
module.  lnet_parse_route() explicitly allows for lnet_add_route() to
return EHOSTUNREACH for just this purpose.

Fixes: f1d0660a5bbe ("lnet: Do not allow gateways on remote nets")
WC-bug-id: https://jira.whamcloud.com/browse/LU-12595
Lustre-commit: 7c12c24c8a10 ("LU-12595 lnet: Return EHOSTUNREACH for unreachable gateway")
Signed-off-by: Chris Horn <hornc@cray.com>
Reviewed-on: https://review.whamcloud.com/35630
Reviewed-by: Alexey Lyashkov <c17817@cray.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
 net/lnet/lnet/router.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c
index 892164b..4ab587d 100644
--- a/net/lnet/lnet/router.c
+++ b/net/lnet/lnet/router.c
@@ -448,7 +448,7 @@  static void lnet_shuffle_seed(void)
 		CERROR("Cannot add route with gateway %s. There is no local interface configured on LNet %s\n",
-		return -EINVAL;
+		return -EHOSTUNREACH;
 	/* Assume net, route, all new */