]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: limit --io-threads to avoid wait forever in do_bench 12697/head
authorYunchuan Wen <yunchuan.wen@kylin-cloud.com>
Wed, 28 Dec 2016 09:20:06 +0000 (17:20 +0800)
committerYunchuan Wen <yunchuan.wen@kylin-cloud.com>
Wed, 28 Dec 2016 09:33:31 +0000 (17:33 +0800)
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
src/tools/rbd/action/Bench.cc

index 413226b3406ca9a77af7fb640a88aa4050da77cd..3df08c9bde1edb41de236b938a24b49a9fd82960 100644 (file)
@@ -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")) {