Whamcloud - gitweb
b=21966 can not mount mdt after umount
authorRahul Deshmukh <Rahul.Deshmukh@sun.com>
Wed, 7 Apr 2010 17:18:18 +0000 (10:18 -0700)
committerRobert Read <robert.read@oracle.com>
Wed, 7 Apr 2010 17:18:18 +0000 (10:18 -0700)
i=johann

lustre/obdclass/lprocfs_status.c

index 00ae233..e4b063e 100644 (file)
@@ -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",