]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix problem with marking unavailable bdev label positions
authorAdam Kupczyk <akupczyk@ibm.com>
Fri, 2 Feb 2024 15:41:39 +0000 (15:41 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Mon, 22 Jul 2024 12:28:50 +0000 (12:28 +0000)
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 <akupczyk@ibm.com>
src/os/bluestore/BlueStore.cc

index 57fc4db7d544a01f9a6deb8a034b0cf969f0ae58..ba79ee208030526ea59a4f46968be1fc1ac1e798 100644 (file)
@@ -7139,9 +7139,6 @@ int BlueStore::_init_alloc(std::map<uint64_t, uint64_t> *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) {