From: Yunchuan Wen Date: Wed, 28 Dec 2016 09:20:06 +0000 (+0800) Subject: rbd: limit --io-threads to avoid wait forever in do_bench X-Git-Tag: v12.0.0~293^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d725523a89c196530f056ea959d336f9de5a78f;p=ceph.git rbd: limit --io-threads to avoid wait forever in do_bench Signed-off-by: Yunchuan Wen --- diff --git a/src/tools/rbd/action/Bench.cc b/src/tools/rbd/action/Bench.cc index 413226b3406..3df08c9bde1 100644 --- a/src/tools/rbd/action/Bench.cc +++ b/src/tools/rbd/action/Bench.cc @@ -361,6 +361,10 @@ int bench_execute(const po::variables_map &vm, io_type_t bench_io_type) { } else { bench_io_threads = 16; } + if (bench_io_threads == 0) { + std::cerr << "rbd: --io-threads should be greater than zero." << std::endl; + return -EINVAL; + } uint64_t bench_bytes; if (vm.count("io-total")) {