From: Adam Kupczyk Date: Fri, 2 Feb 2024 15:41:39 +0000 (+0000) Subject: os/bluestore: Fix problem with marking unavailable bdev label positions X-Git-Tag: v20.0.0~1321^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ab22a84ccd7dc9348ea317928878e19ff4921f2;p=ceph.git 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 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 57fc4db7d544..ba79ee208030 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) {