]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: use double in _set_cache_sizes
authorSage Weil <sage@redhat.com>
Tue, 13 Jun 2017 03:18:56 +0000 (23:18 -0400)
committerSage Weil <sage@redhat.com>
Tue, 13 Jun 2017 03:18:56 +0000 (23:18 -0400)
Freaking floating point imprecision sucks.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index e89986833920896c961c6d4e1bbdc1c5cbfad872..756351da78ec89401f68e2434365d503518ae5b3 100644 (file)
@@ -3545,7 +3545,8 @@ int BlueStore::_set_cache_sizes()
 {
   cache_meta_ratio = cct->_conf->bluestore_cache_meta_ratio;
   cache_kv_ratio = cct->_conf->bluestore_cache_kv_ratio;
-  cache_data_ratio = 1.0 - cache_meta_ratio - cache_kv_ratio;
+  cache_data_ratio =
+    (double)1.0 - (double)cache_meta_ratio - (double)cache_kv_ratio;
 
   if (cache_meta_ratio <= 0 || cache_meta_ratio > 1.0) {
     derr << __func__ << "bluestore_cache_meta_ratio (" << cache_meta_ratio