From 9d725523a89c196530f056ea959d336f9de5a78f Mon Sep 17 00:00:00 2001 From: Yunchuan Wen Date: Wed, 28 Dec 2016 17:20:06 +0800 Subject: [PATCH] rbd: limit --io-threads to avoid wait forever in do_bench Signed-off-by: Yunchuan Wen --- src/tools/rbd/action/Bench.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/rbd/action/Bench.cc b/src/tools/rbd/action/Bench.cc index 413226b3406c..3df08c9bde1e 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")) { -- 2.47.3