Skip to content

Commit 358f33a

Browse files
committed
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 <[email protected]>
1 parent a278231 commit 358f33a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/os/bluestore/BlueStore.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20527,6 +20527,14 @@ int BlueStore::read_allocation_from_drive_for_bluestore_tool()
2052720527
if (ret < 0) {
2052820528
return ret;
2052920529
}
20530+
if (bdev_label_multi) {
20531+
uint64_t lsize = std::max(BDEV_LABEL_BLOCK_SIZE, min_alloc_size);
20532+
for (uint64_t p : bdev_label_valid_locations) {
20533+
if (p != BDEV_FIRST_LABEL_POSITION) {
20534+
allocator->init_rm_free(p, lsize);
20535+
}
20536+
}
20537+
}
2053020538

2053120539
duration = ceph_clock_now() - start;
2053220540
stats.insert_count = 0;

0 commit comments

Comments
 (0)