]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Thu, 6 Feb 2025 08:34:54 +0000 (08:34 +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>
(cherry picked from commit 76978bc673a33077f6b8ae53c26ff45ce86da47d)

src/os/bluestore/BlueStore.cc

index 8a0ec7209f52097553605da9ff1c01b65bcce6dc..7091c192568c6e4719640c8d7f3c79365d2e442d 100644 (file)
@@ -8875,6 +8875,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();
 
@@ -8889,15 +8898,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();