From 3ec611d61138de3901944e4fdb50d8872fd472d5 Mon Sep 17 00:00:00 2001 From: Rahul Deshmukh Date: Wed, 7 Apr 2010 10:18:18 -0700 Subject: [PATCH] b=21966 can not mount mdt after umount i=johann --- lustre/obdclass/lprocfs_status.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 00ae233..e4b063e 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -831,7 +831,10 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count, cfs_atomic_read(&imp->imp_inval_count)); lprocfs_stats_collect(obd->obd_svc_stats, PTLRPC_REQWAIT_CNTR, &ret); - do_div(ret.lc_sum, ret.lc_count); + if (ret.lc_count != 0) + do_div(ret.lc_sum, ret.lc_count); + else + ret.lc_sum = 0; i += snprintf(page + i, count - i, " rpcs:\n" " inflight: %u\n" @@ -871,7 +874,7 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count, lprocfs_stats_collect(obd->obd_svc_stats, PTLRPC_LAST_CNTR + BRW_READ_BYTES + rw, &ret); - if (ret.lc_sum > 0) { + if (ret.lc_sum > 0 && ret.lc_count > 0) { do_div(ret.lc_sum, ret.lc_count); i += snprintf(page + i, count - i, " %s_data_averages:\n" @@ -882,7 +885,7 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count, k = (int)ret.lc_sum; j = opcode_offset(OST_READ + rw) + EXTRA_MAX_OPCODES; lprocfs_stats_collect(obd->obd_svc_stats, j, &ret); - if (ret.lc_sum > 0) { + if (ret.lc_sum > 0 && ret.lc_count != 0) { do_div(ret.lc_sum, ret.lc_count); i += snprintf(page + i, count - i, " %s_per_rpc: "LPU64"\n", -- 1.8.3.1