Whamcloud - gitweb
LU-9078 lnet: Fix route hops print 50/25250/3
authorAmir Shehata <amir.shehata@intel.com>
Fri, 3 Feb 2017 20:13:00 +0000 (12:13 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 10 Feb 2017 03:51:47 +0000 (03:51 +0000)
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 <amir.shehata@intel.com>
Change-Id: I13c416b1ff86b55d72ffa124441dc358c9cea97b
Reviewed-on: https://review.whamcloud.com/25250
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/lnet/router_proc.c
lnet/utils/lnetconfig/liblnetconfig.c

index 209adab..8b25f0f 100644 (file)
@@ -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,
                        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",
                                      libcfs_net2str(net), hops,
                                      priority,
                                      alive ? "up" : "down",
index 6aaa1a0..37d254c 100644 (file)
@@ -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",
 
                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;
 
                            NULL)
                                goto out;