]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/rbd: set order to default value if it is not specified in options.
authorDongsheng Yang <dongsheng.yang@easystack.cn>
Mon, 11 Jul 2016 11:44:00 +0000 (07:44 -0400)
committerDongsheng Yang <dongsheng.yang@easystack.cn>
Fri, 22 Jul 2016 11:04:10 +0000 (07:04 -0400)
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
src/tools/rbd/action/Import.cc

index 2eee2e8c4131d327fd3320ef4a0f10c690fb368e..b69bd48e776a590a8c2dc87c69998e87d98e9eb4 100644 (file)
@@ -74,8 +74,9 @@ static int do_import(librbd::RBD &rbd, librados::IoCtx& io_ctx,
   assert(imgname);
 
   uint64_t order;
-  r = opts.get(RBD_IMAGE_OPTION_ORDER, &order);
-  assert(r == 0);
+  if (opts.get(RBD_IMAGE_OPTION_ORDER, &order) != 0) {
+    order = g_conf->rbd_default_order;
+  }
 
   // try to fill whole imgblklen blocks for sparsification
   uint64_t image_pos = 0;