From: Sage Weil Date: Tue, 13 Jun 2017 03:18:56 +0000 (-0400) Subject: os/bluestore: use double in _set_cache_sizes X-Git-Tag: v12.1.0~103^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ac04d12b424a9a852f557f9c31a477d90bbbc42e;p=ceph.git os/bluestore: use double in _set_cache_sizes Freaking floating point imprecision sucks. Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e89986833920..756351da78ec 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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