[lustre-devel] [PATCH 571/622] lnet: Avoid comparing route to itself

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


From: Chris Horn <hornc at cray.com>

The first iteration of the route selection loop compares the first
route in the list with itself.

WC-bug-id: https://jira.whamcloud.com/browse/LU-12756
Lustre-commit: 2b8d9d12d182 ("LU-12756 lnet: Avoid comparing route to itself")
Signed-off-by: Chris Horn <hornc at cray.com>
Reviewed-on: https://review.whamcloud.com/36535
Reviewed-by: Alexandr Boyko <c17825 at cray.com>
Reviewed-by: Alexey Lyashkov <c17817 at cray.com>
Reviewed-by: Amir Shehata <ashehata at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 net/lnet/lnet/lib-move.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index c8266f0..45975d6 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -1354,6 +1354,12 @@ void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
 			best_route = route;
 			last_route = route;
 			lp_best = lp;
+			best_gw_ni = lnet_find_best_lpni_on_net(NULL,
+								LNET_NID_ANY,
+								route->lr_gateway,
+								route->lr_lnet);
+			LASSERT(best_gw_ni);
+			continue;
 		}
 
 		/* no protection on below fields, but it's harmless */
-- 
1.8.3.1



More information about the lustre-devel mailing list