From: Adam Kupczyk Date: Thu, 12 Sep 2024 10:43:40 +0000 (+0000) Subject: tools/ceph-bluestore-tool: Allow show-label even if OSD is running X-Git-Tag: testing/wip-vshankar-testing-20241106.074359-squid-debug~110^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9901166964422caf0352a450b42198eda7230a4d;p=ceph-ci.git 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) --- 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;