From 9901166964422caf0352a450b42198eda7230a4d Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Thu, 12 Sep 2024 10:43:40 +0000 Subject: [PATCH] tools/ceph-bluestore-tool: Allow show-label even if OSD is running ceph-volume needs to query the devices for `ceph-volume raw list`. Signed-off-by: Adam Kupczyk (cherry picked from commit 1b431a3757e7f27224a5267722e07188fa191d53) --- src/os/bluestore/BlueStore.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 33b489cf48b..3b1e97c2b82 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6872,6 +6872,10 @@ int BlueStore::read_bdev_label( { unique_ptr 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; -- 2.39.5