From: Amir Shehata Date: Fri, 3 Feb 2017 20:13:00 +0000 (-0800) Subject: LU-9078 lnet: Fix route hops print X-Git-Tag: 2.9.53~3 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9ab8061abc989be519482888e64e90ebecb228c9 LU-9078 lnet: Fix route hops print The default number of hops for a route is -1. This is currently being printed as %u. Change that to %d to make it print out properly. Test-Parameters: trivial Signed-off-by: Amir Shehata Change-Id: I13c416b1ff86b55d72ffa124441dc358c9cea97b Reviewed-on: https://review.whamcloud.com/25250 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Olaf Weber Reviewed-by: Doug Oucharek Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lnet/lnet/router_proc.c b/lnet/lnet/router_proc.c index 209adab..8b25f0f 100644 --- a/lnet/lnet/router_proc.c +++ b/lnet/lnet/router_proc.c @@ -228,7 +228,7 @@ proc_lnet_routes(struct ctl_table *table, int write, void __user *buffer, int alive = lnet_is_route_alive(route); s += snprintf(s, tmpstr + tmpsiz - s, - "%-8s %4u %8u %7s %s\n", + "%-8s %4d %8u %7s %s\n", libcfs_net2str(net), hops, priority, alive ? "up" : "down", diff --git a/lnet/utils/lnetconfig/liblnetconfig.c b/lnet/utils/lnetconfig/liblnetconfig.c index 6aaa1a0..37d254c 100644 --- a/lnet/utils/lnetconfig/liblnetconfig.c +++ b/lnet/utils/lnetconfig/liblnetconfig.c @@ -807,8 +807,8 @@ int lustre_lnet_show_route(char *nw, char *gw, int hops, int prio, int detail, if (detail) { if (cYAML_create_number(item, "hop", - data.cfg_config_u.cfg_route. - rtr_hop) == + (int) data.cfg_config_u. + cfg_route.rtr_hop) == NULL) goto out;