From: Igor Fedotov Date: Wed, 16 Feb 2022 21:13:45 +0000 (+0300) Subject: os/bluestore: fix edge case for bitmap alloc's claim_free_to_left(0) X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7bc78aa857738a69f0e4c2ad81d702c6f5e7dffd;p=ceph.git os/bluestore: fix edge case for bitmap alloc's claim_free_to_left(0) call. This imporperly marked the first 64 chunks as allocated. Apaprently not critical for production since offset(0) is never released. Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/fastbmap_allocator_impl.cc b/src/os/bluestore/fastbmap_allocator_impl.cc index 4f735ba2efeeb..4833b9d1a7b78 100644 --- a/src/os/bluestore/fastbmap_allocator_impl.cc +++ b/src/os/bluestore/fastbmap_allocator_impl.cc @@ -623,7 +623,7 @@ uint64_t AllocatorLevel01Loose::_claim_free_to_left_l0(int64_t l0_pos_start) { int64_t d0 = L0_ENTRIES_PER_SLOT; - int64_t pos = l0_pos_start - 1; + int64_t pos = l0_pos_start ? l0_pos_start - 1 : 0; slot_t bits = (slot_t)1 << (pos % d0); int64_t idx = pos / d0; slot_t* val_s = l0.data() + idx;