From 54b12f535d25178e79b5576a99b56ce594af6540 Mon Sep 17 00:00:00 2001 From: xudonghai Date: Wed, 23 Dec 2015 15:51:48 +0800 Subject: [PATCH] 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 --- src/tools/rbd/Utils.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/rbd/Utils.cc b/src/tools/rbd/Utils.cc index 1cad7c9ca7e..4f4b2e87824 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; } -- 2.47.3