From 9ab22a84ccd7dc9348ea317928878e19ff4921f2 Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Fri, 2 Feb 2024 15:41:39 +0000 Subject: [PATCH] os/bluestore: Fix problem with marking unavailable bdev label positions It was attempted to mark bdev label locations as taken before adding bluefs allocation on main. This in turn caused collision when bluefs finally tried to mark regions. Signed-off-by: Adam Kupczyk --- src/os/bluestore/BlueStore.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 57fc4db7d54..ba79ee20803 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -7139,9 +7139,6 @@ int BlueStore::_init_alloc(std::map *zone_adjustments) } } } - if (bdev_label_multi) { - _main_bdev_label_try_reserve(); - } dout(1) << __func__ << " loaded " << byte_u_t(bytes) << " in " << num << " extents" << std::hex @@ -7639,6 +7636,10 @@ int BlueStore::_open_db_and_around(bool read_only, bool to_repair) _post_init_alloc(zone_adjustments); } + if (bdev_label_multi) { + _main_bdev_label_try_reserve(); + } + // when function is called in repair mode (to_repair=true) we skip db->open()/create() // we can't change bluestore allocation so no need to invlidate allocation-file if (fm->is_null_manager() && !read_only && !to_repair) { -- 2.47.3