Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
}
if (alloc_len < 0 || alloc_len < need) {
if (alloc[id]) {
- if (alloc_len > 0) {
+ if (extents.size()) {
alloc[id]->release(extents);
+ extents.clear();
}
if (!was_cooldown && shared) {
auto delay_s = cct->_conf->bluefs_failed_shared_alloc_cooldown;
<< " min_alloc_size 0x" << min_alloc_size
<< " available 0x " << alloc->get_free()
<< std::dec << dendl;
- if (alloc_len > 0) {
+ if (exts.size()) {
alloc->release(exts);
}
bypass_rest = true;
PExtentVector exts;
int64_t alloc_len = alloc->allocate(len, min_alloc_size,
min_alloc_size * 256, 0, &exts);
-
+ ceph_assert(alloc_len >= 0); // generally we do not expect any errors
if (fm->is_null_manager()) {
return;
}