Whamcloud - gitweb
LU-5828 lnet: showing buffers problem with mulitple CPTs 93/12593/3
authorAmir Shehata <amir.shehata@intel.com>
Wed, 5 Nov 2014 22:32:59 +0000 (14:32 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 9 Dec 2014 08:12:44 +0000 (08:12 +0000)
Overloading an iterator variable in lustre_lnet_show_routing()
caused only the first CPT information to be displayed.

Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Change-Id: Ic75dccc0c3537b8272d1c2687a759fbcc23052e8
Reviewed-on: http://review.whamcloud.com/12593
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/utils/lnetconfig/liblnetconfig.c

index 5f8d1cf..29d286c 100644 (file)
@@ -838,7 +838,7 @@ int lustre_lnet_show_routing(int seq_no, struct cYAML **show_rc,
        struct cYAML *root = NULL, *pools_node = NULL,
                     *type_node = NULL, *item = NULL, *cpt = NULL,
                     *first_seq = NULL;
-       int i;
+       int i, j;
        char err_str[LNET_MAX_STR_LEN];
        char node_name[LNET_MAX_STR_LEN];
 
@@ -883,24 +883,24 @@ int lustre_lnet_show_routing(int seq_no, struct cYAML **show_rc,
                        goto out;
 
                /* create the tree  and print */
-               for (i = 0; i < LNET_NRBPOOLS; i++) {
-                       type_node = cYAML_create_object(cpt, pools[i]);
+               for (j = 0; j < LNET_NRBPOOLS; j++) {
+                       type_node = cYAML_create_object(cpt, pools[j]);
                        if (type_node == NULL)
                                goto out;
                        if (cYAML_create_number(type_node, "npages",
-                                               pool_cfg->pl_pools[i].pl_npages)
+                                               pool_cfg->pl_pools[j].pl_npages)
                            == NULL)
                                goto out;
                        if (cYAML_create_number(type_node, "nbuffers",
-                                               pool_cfg->pl_pools[i].
+                                               pool_cfg->pl_pools[j].
                                                  pl_nbuffers) == NULL)
                                goto out;
                        if (cYAML_create_number(type_node, "credits",
-                                               pool_cfg->pl_pools[i].
+                                               pool_cfg->pl_pools[j].
                                                   pl_credits) == NULL)
                                goto out;
                        if (cYAML_create_number(type_node, "mincredits",
-                                               pool_cfg->pl_pools[i].
+                                               pool_cfg->pl_pools[j].
                                                   pl_mincredits) == NULL)
                                goto out;
                }