From: Adam Kupczyk Date: Fri, 13 Sep 2024 16:39:51 +0000 (+0000) Subject: os/bluestore: Fix ceph-bluestore-tool allocmap command X-Git-Tag: v20.0.0~811^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=358f33a148c9a65478e33648f16e8c8af73c98f2;p=ceph.git os/bluestore: Fix ceph-bluestore-tool allocmap command BlueStore::read_allocation_from_drive_for_bluestore_tool was not informed that multiple bdev labels can exist and reserve space. Comparison of real alloc vs recovered alloc was failing. Fixes: https://tracker.ceph.com/issues/67596 Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 236336386728..069105bc8d67 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -20527,6 +20527,14 @@ int BlueStore::read_allocation_from_drive_for_bluestore_tool() if (ret < 0) { return ret; } + if (bdev_label_multi) { + uint64_t lsize = std::max(BDEV_LABEL_BLOCK_SIZE, min_alloc_size); + for (uint64_t p : bdev_label_valid_locations) { + if (p != BDEV_FIRST_LABEL_POSITION) { + allocator->init_rm_free(p, lsize); + } + } + } duration = ceph_clock_now() - start; stats.insert_count = 0;