]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerPere Diaz Bou <pere-altea@hotmail.com>
Fri, 23 Aug 2024 09:49:24 +0000 (11:49 +0200)
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>
(cherry picked from commit 9ab22a84ccd7dc9348ea317928878e19ff4921f2)

src/os/bluestore/BlueStore.cc

index 1db2222f9b1f2df088f45fd0bd120c6b68871b36..745eeefed19b7185c6d5fc85287106c06dc08ce5 100644 (file)
@@ -7114,9 +7114,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
@@ -7614,6 +7611,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) {