Skip to content

Commit

Permalink
os/bluestore: uniform allocator's error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
  • Loading branch information
ifed01 committed Jul 27, 2023
1 parent 4b0c070 commit 11549b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/os/bluestore/BlueFS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3802,8 +3802,9 @@ int BlueFS::_allocate(uint8_t id, uint64_t len,
}
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;
Expand Down
4 changes: 2 additions & 2 deletions src/os/bluestore/BlueStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9666,7 +9666,7 @@ int BlueStore::_fsck_on_open(BlueStore::FSCKDepth depth, bool repair)
<< " 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;
Expand Down Expand Up @@ -10122,7 +10122,7 @@ void BlueStore::inject_leaked(uint64_t len)
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;
}
Expand Down

0 comments on commit 11549b0

Please sign in to comment.