]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fix edge case for bitmap alloc's claim_free_to_left(0)
authorIgor Fedotov <igor.fedotov@croit.io>
Wed, 16 Feb 2022 21:13:45 +0000 (00:13 +0300)
committerJoshua Baergen <jbaergen@digitalocean.com>
Wed, 9 Apr 2025 19:39:02 +0000 (13:39 -0600)
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 <igor.fedotov@croit.io>
src/os/bluestore/fastbmap_allocator_impl.cc

index 4f735ba2efeebbe49c578d38cfa3d0cdc57f0dc0..4833b9d1a7b780481e2e6724d092ac200e5ac33f 100644 (file)
@@ -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;