]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix CBT bluefs-bdev-expand
authorAdam Kupczyk <akupczyk@ibm.com>
Tue, 21 Jan 2025 17:07:56 +0000 (17:07 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Tue, 21 Jan 2025 17:07:56 +0000 (17:07 +0000)
This is a fixup to original "Fix CBT bluefs-bdev-expand" commit.
Somehow, the code was placed in wrong place.

Re-Fixes: https://tracker.ceph.com/issues/68577

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index 8f1d995fa8db8ca0e58b97b70876b1b747b90e77..5a0379030d3f0a6a306ae3e8e6d23ab558c945e1 100644 (file)
@@ -8974,6 +8974,15 @@ int BlueStore::expand_devices(ostream& out)
           << " : size label updated to " << size
           << std::endl;
       }
+      if (bdev_label_multi) {
+        uint64_t lsize = std::max(BDEV_LABEL_BLOCK_SIZE, min_alloc_size);
+        for (uint64_t loc : bdev_label_positions) {
+          if ((loc >= size0) && (loc + lsize <= size)) {
+            bdev_label_valid_locations.push_back(loc);
+          }
+        }
+        _write_bdev_label(cct, bdev, path + "/block", bdev_label, bdev_label_valid_locations);
+      }
     }
     _close_db_and_around();
 
@@ -8988,15 +8997,6 @@ int BlueStore::expand_devices(ostream& out)
     if (fm && fm->is_null_manager()) {
       // we grow the allocation range, must reflect it in the allocation file
       alloc->init_add_free(size0, size - size0);
-      if (bdev_label_multi) {
-        uint64_t lsize = std::max(BDEV_LABEL_BLOCK_SIZE, min_alloc_size);
-        for (uint64_t loc : bdev_label_positions) {
-          if ((loc >= size0) && (loc + lsize <= size)) {
-            bdev_label_valid_locations.push_back(loc);
-          }
-        }
-        _write_bdev_label(cct, bdev, path + "/block", bdev_label, bdev_label_valid_locations);
-      }
       need_to_destage_allocation_file = true;
     }
     umount();