From: Rajesh Nambiar Date: Wed, 8 Apr 2015 06:31:48 +0000 (-0700) Subject: rbd: create command throws inappropriate error messages X-Git-Tag: v9.0.0~8^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b0172d870e526753ea957e6781d64d590af6d047;p=ceph.git rbd: create command throws inappropriate error messages Fixes: #2862 Changes related to rbd file Changes to rbd.cc ----------------- Change 1: line# 2744 to 2747 If the option is --order then do the check of its value if its less than 12 or greaterthan 25 then throw error. Correct value of --order is 12 to 25. Change 2: Removal of validation from line# 3205 to 3209 Since the check for correct value of --order is done before hence the check here is not needed. Signed-off-by: Rajesh Nambiar --- diff --git a/src/rbd.cc b/src/rbd.cc index 50a044aa1838..37be146d67a5 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -2799,6 +2799,10 @@ int main(int argc, const char **argv) cerr << "rbd: " << err.str() << std::endl; return EXIT_FAILURE; } + if ((order <= 0) || (order < 12) || (order > 25)) { + cerr << "rbd: order must be between 12 (4 KB) and 25 (32 MB)" << std::endl; + return EXIT_FAILURE; + } } else if (ceph_argparse_witharg(args, i, &bench_io_size, &err, "--io-size", (char*)NULL)) { if (!err.str().empty()) { cerr << "rbd: " << err.str() << std::endl; @@ -3308,11 +3312,6 @@ if (!set_conf_param(v, p1, p2, p3)) { \ } if (opt_cmd == OPT_CREATE || opt_cmd == OPT_CLONE || opt_cmd == OPT_IMPORT) { - if (order && (order < 12 || order > 25)) { - cerr << "rbd: order must be between 12 (4 KB) and 25 (32 MB)" - << std::endl; - return EINVAL; - } if ((stripe_unit && !stripe_count) || (!stripe_unit && stripe_count)) { cerr << "must specify both (or neither) of stripe-unit and stripe-count" << std::endl;