]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd:must specify both of stripe-unit and stripe-count when specify striping features 7026/head
authorxudonghai <xu.donghai@h3c.com>
Wed, 23 Dec 2015 07:51:48 +0000 (15:51 +0800)
committerxudonghai <xu.donghai@h3c.com>
Wed, 23 Dec 2015 07:59:09 +0000 (15:59 +0800)
when create a rbd image with striping features, Be sure specify both of stirpe-unit and stripe-count too, If not, refuse to excute and give a message

Signed-off-by:Donghai Xu <xu.donghai@h3c.com>

src/tools/rbd/Utils.cc

index 1cad7c9ca7e62306ce2ffde742e15cea9dff6359..4f4b2e87824fd0a88dd57152bf733a464db86120 100644 (file)
@@ -366,6 +366,10 @@ int get_image_options(const boost::program_options::variables_map &vm,
     }
     features |= RBD_FEATURE_STRIPINGV2;
   } else {
+    if (features_specified && ((features & RBD_FEATURE_STRIPINGV2) != 0)) {
+      std::cerr << "must specify both of stripe-unit and stripe-count when specify striping features" << std::endl;
+      return -EINVAL;
+    }
     features &= ~RBD_FEATURE_STRIPINGV2;
   }