]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore:fixed bug for judging the return value in _open_alloc() 13577/head
authoryonghengdexin735 <zhang.zezhu@zte.com.cn>
Wed, 22 Feb 2017 07:12:04 +0000 (15:12 +0800)
committeryonghengdexin735 <zhang.zezhu@zte.com.cn>
Thu, 16 Mar 2017 01:39:06 +0000 (09:39 +0800)
Signed-off-by: yonghengdexin735 <zhang.zezhu@zte.com.cn>
src/os/bluestore/BlueStore.cc

index d0039a34823f01b146666efa2b869dbe64e9d82c..d0ba78f7af6bb2effdff3d88d6bac1b058ddd51f 100644 (file)
@@ -3760,6 +3760,13 @@ int BlueStore::_open_alloc()
   alloc = Allocator::create(cct, cct->_conf->bluestore_allocator,
                             bdev->get_size(),
                             min_alloc_size);
+  if (!alloc) {
+    lderr(cct) << __func__ << " Allocator::unknown alloc type "
+               << cct->_conf->bluestore_allocator
+               << dendl;
+    return -EINVAL;
+  }
+
   uint64_t num = 0, bytes = 0;
 
   // initialize from freelist