os/bluestore: handle small main device properly

Originally reported by MarcinDulak on 'ceph-users' channel.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
xie xingguo 2017-09-01 15:53:38 +08:00
parent d0f6580a83
commit 9f94f9f00e

View File

@ -4124,6 +4124,13 @@ int BlueStore::_open_bdev(bool create)
if (r < 0) {
goto fail_close;
}
if (bdev->get_size() < cct->_conf->bluestore_bluefs_min) {
dout(1) << __func__ << " main device size " << si_t(bdev->get_size())
<< " is too small, disable bluestore_bluefs_min for now"
<< dendl;
int r = cct->_conf->set_val("bluestore_bluefs_min", "0");
assert(r == 0);
}
return 0;
fail_close: