From: huangjun Date: Mon, 20 Jul 2015 02:50:20 +0000 (+0800) Subject: mon/PGMonitor: avoid uint64_t overflow when checking pool 'target/max' status. X-Git-Tag: v0.80.11~45^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea0d67c482659dfb8c08055a77f400d0689866e0;p=ceph.git mon/PGMonitor: avoid uint64_t overflow when checking pool 'target/max' status. Fixes: #12401 Signed-off-by: huangjun (cherry picked from commit f84e6b8157e78fd05cd1c8ac957c92df17e6ba06) --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 3e0523bba89..c2486354c2d 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1991,7 +1991,7 @@ void PGMonitor::get_health(list >& summary, ((1000000 - p->second.cache_target_full_ratio_micro) * g_conf->mon_cache_target_full_warn_ratio); if (p->second.target_max_objects && (uint64_t)st.stats.sum.num_objects > - p->second.target_max_objects * ratio / 1000000) { + p->second.target_max_objects * (ratio / 1000000.0)) { nearfull = true; if (detail) { ostringstream ss; @@ -2003,7 +2003,7 @@ void PGMonitor::get_health(list >& summary, } } if (p->second.target_max_bytes && (uint64_t)st.stats.sum.num_bytes > - p->second.target_max_bytes * ratio / 1000000) { + p->second.target_max_bytes * (ratio / 1000000.0)) { nearfull = true; if (detail) { ostringstream ss;