diff options
-rw-r--r-- | src/os/bluestore/BlueStore.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 0adab146c84..3cc7f71b31f 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -6928,6 +6928,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; |