From: Chris Horn Date: Fri, 26 Jul 2019 21:08:00 +0000 (-0500) Subject: LU-12595 lnet: Return EHOSTUNREACH for unreachable gateway X-Git-Tag: 2.12.4-RC1~59 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F36871%2F2;p=fs%2Flustre-release.git LU-12595 lnet: Return EHOSTUNREACH for unreachable gateway Commit 43b35351e9ca258773e89c2d68047e939fb822fb 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. Lustre-change: https://review.whamcloud.com/35630 Lustre-commit: 7c12c24c8a10be2d0ad005d6d99d97cee6bcde18 Test-parameters: trivial Fixes: 43b35351e9 ("LU-12411 lnet: Do not allow gateways on remote nets") Signed-off-by: Chris Horn Change-Id: Ia0f28779a3505eff02dafdc23a6e01c1d0cbc84b Reviewed-by: Alexey Lyashkov Reviewed-by: Amir Shehata Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/36871 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Oleg Drokin --- diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index 496fe95..6c0c267 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -345,7 +345,7 @@ lnet_add_route(__u32 net, __u32 hops, lnet_nid_t 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; + return -EHOSTUNREACH; } /* Assume net, route, all new */