From: xudonghai Date: Wed, 23 Dec 2015 07:51:48 +0000 (+0800) Subject: rbd:must specify both of stripe-unit and stripe-count when specify striping features X-Git-Tag: v10.0.3~167^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F7026%2Fhead;p=ceph.git rbd:must specify both of stripe-unit and stripe-count when specify striping features 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 --- diff --git a/src/tools/rbd/Utils.cc b/src/tools/rbd/Utils.cc index 1cad7c9ca7e6..4f4b2e87824f 100644 --- a/src/tools/rbd/Utils.cc +++ b/src/tools/rbd/Utils.cc @@ -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; }