]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph-bluestore-tool: Allow show-label even if OSD is running
authorAdam Kupczyk <akupczyk@ibm.com>
Thu, 12 Sep 2024 10:43:40 +0000 (10:43 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 25 Sep 2024 06:13:23 +0000 (06:13 +0000)
ceph-volume needs to query the devices for `ceph-volume raw list`.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 1b431a3757e7f27224a5267722e07188fa191d53)

src/os/bluestore/BlueStore.cc

index 33b489cf48bee0569f9637e3617b4acea486743f..3b1e97c2b823ed0eb81c2acc1de9a32e45476a12 100644 (file)
@@ -6872,6 +6872,10 @@ int BlueStore::read_bdev_label(
 {
   unique_ptr<BlockDevice> bdev(BlockDevice::create(
     cct, path, nullptr, nullptr, nullptr, nullptr));
+  if (!bdev) {
+    return -EIO;
+  }
+  bdev->set_no_exclusive_lock();
   int r = bdev->open(path);
   if (r < 0)
     return r;