From 82fc1da141f00fb584d2c7c3e176a8f35f99f504 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 13 Jun 2017 12:11:27 -0400 Subject: [PATCH] os/bluestore: clean up cache_data_ratio in _set_cache_sizes Signed-off-by: Sage Weil --- src/os/bluestore/BlueStore.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 756351da78e..988d8c24ec1 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3565,6 +3565,10 @@ int BlueStore::_set_cache_sizes() << dendl; return -EINVAL; } + if (cache_data_ratio < 0) { + // deal with floating point imprecision + cache_data_ratio = 0; + } dout(1) << __func__ << " meta " << cache_meta_ratio << " kv " << cache_kv_ratio << " data " << cache_data_ratio -- 2.47.3