]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: Move reservation of bdev label to proper place.
authorAdam Kupczyk <akupczyk@ibm.com>
Wed, 18 Sep 2024 07:32:09 +0000 (07:32 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 25 Sep 2024 07:47:03 +0000 (07:47 +0000)
Reservation (alloc->init_rm_free) was after reopening DB in r/w mode.
This was a problem - as soon as DB is in r/w it can flush sst or compact,
which will make allocations.

Fixes: https://tracker.ceph.com/issues/68222
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 9dd0b2369f9c07548074f778ad47614f9d7caa4e)

src/os/bluestore/BlueStore.cc

index 90cedb90abaeea38266f6547ede005b085c7496c..d385c26c7b5161c1de4aea652758fb91cdc6d983 100644 (file)
@@ -7664,6 +7664,10 @@ int BlueStore::_open_db_and_around(bool read_only, bool to_repair)
   if (r < 0)
     goto out_fm;
 
+  if (bdev_label_multi) {
+    _main_bdev_label_try_reserve();
+  }
+
   // Re-open in the proper mode(s).
 
   // Can't simply bypass second open for read-only mode as we need to
@@ -7680,10 +7684,6 @@ 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) {