From 7bc78aa857738a69f0e4c2ad81d702c6f5e7dffd Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Thu, 17 Feb 2022 00:13:45 +0300 Subject: [PATCH] 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 --- src/os/bluestore/fastbmap_allocator_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5