From: Sage Weil Date: Sat, 26 Mar 2016 14:30:34 +0000 (-0400) Subject: os/bluestore: do not do gift beyond the max ratio X-Git-Tag: v10.1.1~28^2~12 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4ea630a409d63c647dffc7df91a8acb91134d137;p=ceph.git os/bluestore: do not do gift beyond the max ratio Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 1f516490c7964..46965fded754f 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1483,6 +1483,14 @@ int BlueStore::_balance_bluefs_freespace(vector *extents, gift = g; reclaim = 0; } + if (gift) { + float new_bluefs_ratio = (float)(bluefs_free + gift) / (float)total_free; + if (new_bluefs_ratio >= g_conf->bluestore_bluefs_max_ratio) { + dout(10) << __func__ << " gift would push us past the max_ratio," + << " doing nothing" << dendl; + gift = 0; + } + } if (gift) { // round up to alloc size