]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix ceph-bluestore-tool allocmap command 60335/head
authorAdam Kupczyk <akupczyk@ibm.com>
Fri, 13 Sep 2024 16:39:51 +0000 (16:39 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Tue, 15 Oct 2024 18:45:32 +0000 (18:45 +0000)
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/68560
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 358f33a148c9a65478e33648f16e8c8af73c98f2)

src/os/bluestore/BlueStore.cc

index c883f6fb7dba84e2fb157b7e7aeaeed0e1800d4f..25ec963cde179165592893ce7b588272fb605544 100644 (file)
@@ -20190,6 +20190,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;