]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix ceph-bluestore-tool allocmap command 59782/head
authorAdam Kupczyk <akupczyk@ibm.com>
Fri, 13 Sep 2024 16:39:51 +0000 (16:39 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 25 Sep 2024 07:39:46 +0000 (07:39 +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/67596
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index 236336386728f24302b1ce9b3a80eaf67c1696c5..069105bc8d67c47d0a017714c510fa655fc0683b 100644 (file)
@@ -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;