From 9ab8061abc989be519482888e64e90ebecb228c9 Mon Sep 17 00:00:00 2001 From: Amir Shehata Date: Fri, 3 Feb 2017 12:13:00 -0800 Subject: [PATCH] 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 --- lnet/lnet/router_proc.c | 2 +- lnet/utils/lnetconfig/liblnetconfig.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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; -- 1.8.3.1