<< " > max_ratio " << g_conf->bluestore_bluefs_max_ratio
<< ", should reclaim " << pretty_si_t(reclaim) << dendl;
}
- if (bluefs_total < g_conf->bluestore_bluefs_min) {
- uint64_t g = g_conf->bluestore_bluefs_min;
+ if (bluefs_total < g_conf->bluestore_bluefs_min &&
+ g_conf->bluestore_bluefs_min <
+ (uint64_t)(g_conf->bluestore_bluefs_max_ratio * total_free)) {
+ uint64_t g = g_conf->bluestore_bluefs_min - bluefs_total;
dout(10) << __func__ << " bluefs_total " << bluefs_total
<< " < min " << g_conf->bluestore_bluefs_min
<< ", should gift " << pretty_si_t(g) << dendl;
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