]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: handle small main device properly 17416/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 1 Sep 2017 07:53:38 +0000 (15:53 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 1 Sep 2017 07:53:38 +0000 (15:53 +0800)
Originally reported by MarcinDulak on 'ceph-users' channel.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index d274874ea1a76199cfbe60cd632682cc5cccf3a4..a1b0af5d7a9020433b934a0659ff042e22f5bf34 100644 (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: