From: yonghengdexin735 Date: Wed, 22 Feb 2017 07:12:04 +0000 (+0800) Subject: os/bluestore:fixed bug for judging the return value in _open_alloc() X-Git-Tag: v12.0.2~331^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=49bebed03a8a1fda8fa35ae0954d91b5bec02396;p=ceph.git os/bluestore:fixed bug for judging the return value in _open_alloc() Signed-off-by: yonghengdexin735 --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index d0039a34823f..d0ba78f7af6b 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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