Skip to content
Snippets Groups Projects
Commit d62360b7 authored by Nathan Rutman's avatar Nathan Rutman
Browse files

b=15521

missing b1_6 patch to skip 0 stats
parent fab1fe12
No related branches found
No related tags found
No related merge requests found
...@@ -1000,7 +1000,7 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v) ...@@ -1000,7 +1000,7 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v)
struct lprocfs_stats *stats = p->private; struct lprocfs_stats *stats = p->private;
struct lprocfs_counter *cntr = v; struct lprocfs_counter *cntr = v;
struct lprocfs_counter t, ret = { .lc_min = LC_MIN_INIT }; struct lprocfs_counter t, ret = { .lc_min = LC_MIN_INIT };
int i, idx, rc; int i, idx, rc = 0;
unsigned int num_cpu; unsigned int num_cpu;
if (cntr == &(stats->ls_percpu[0])->lp_cntr[0]) { if (cntr == &(stats->ls_percpu[0])->lp_cntr[0]) {
...@@ -1041,6 +1041,9 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v) ...@@ -1041,6 +1041,9 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v)
ret.lc_sumsquare += t.lc_sumsquare; ret.lc_sumsquare += t.lc_sumsquare;
} }
if (ret.lc_count == 0)
goto out;
rc = seq_printf(p, "%-25s "LPD64" samples [%s]", cntr->lc_name, rc = seq_printf(p, "%-25s "LPD64" samples [%s]", cntr->lc_name,
ret.lc_count, cntr->lc_units); ret.lc_count, cntr->lc_units);
if (rc < 0) if (rc < 0)
...@@ -1535,8 +1538,8 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid) ...@@ -1535,8 +1538,8 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
!exp->exp_obd->obd_nid_stats_hash) !exp->exp_obd->obd_nid_stats_hash)
RETURN(-EINVAL); RETURN(-EINVAL);
/* not test against zero because eric say: /* not test against zero because eric say:
* You may only test nid against another nid, or LNET_NID_ANY. * You may only test nid against another nid, or LNET_NID_ANY.
* Anything else is nonsense.*/ * Anything else is nonsense.*/
if (!nid || *nid == LNET_NID_ANY) if (!nid || *nid == LNET_NID_ANY)
RETURN(0); RETURN(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment