From: Adam Kupczyk Date: Tue, 21 Jan 2025 17:07:56 +0000 (+0000) Subject: os/bluestore: Fix CBT bluefs-bdev-expand X-Git-Tag: v19.2.3~334^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=10d4453488bae8008ab40428a20ddcaea0e1ca52;p=ceph.git os/bluestore: Fix CBT bluefs-bdev-expand 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 (cherry picked from commit 76978bc673a33077f6b8ae53c26ff45ce86da47d) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 8a0ec7209f52..7091c192568c 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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();