]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor.cc: fix UNINTENDED_INTEGER_DIVISION
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 9 Jun 2015 12:57:54 +0000 (14:57 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 17 Jul 2015 08:50:45 +0000 (10:50 +0200)
Fix for:

CID 1297885 (#1 of 2): Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
 integer_division: Dividing integer expressions g_conf->mon_pool_quota_warn_threshold
 and 100, and then converting the integer quotient to type float. Any remainder,
 or fractional part of the quotient, is ignored.

CID 1297885 (#2 of 2): Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
 integer_division: Dividing integer expressions g_conf->mon_pool_quota_crit_threshold
 and 100, and then converting the integer quotient to type float. Any remainder,
  or fractional part of the quotient, is ignored.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mon/OSDMonitor.cc

index a4bab5dd504a7eb5a29115b3bc75877f98ff55e1..e6ab163eb365e86721c30dc6c00dd17b64fafb4e 100644 (file)
@@ -3896,8 +3896,8 @@ void OSDMonitor::get_pools_health(
        detail->push_back(make_pair(HEALTH_WARN, ss.str()));
     }
 
-    float warn_threshold = g_conf->mon_pool_quota_warn_threshold/100;
-    float crit_threshold = g_conf->mon_pool_quota_crit_threshold/100;
+    float warn_threshold = (float)g_conf->mon_pool_quota_warn_threshold/100;
+    float crit_threshold = (float)g_conf->mon_pool_quota_crit_threshold/100;
 
     if (pool.quota_max_objects > 0) {
       stringstream ss;