]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crushtool: safeguard for missing --num-rep when --test 2508/head
authorLoic Dachary <loic-201408@dachary.org>
Tue, 16 Sep 2014 18:29:12 +0000 (20:29 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Tue, 16 Sep 2014 19:18:52 +0000 (21:18 +0200)
http://tracker.ceph.com/issues/9490 Fixes: #9490

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/tools/crushtool.cc

index ccb0efda74a7c7d57b7158520e95347daa716073..10adc11a49541b007e049b8bd28dc9260b684c2b 100644 (file)
@@ -729,6 +729,10 @@ int main(int argc, const char **argv)
   }
 
   if (test) {
+    if (tester.get_min_rep() < 1 || tester.get_max_rep() < 1) {
+      cerr << me << " --test requires --num-rep with a value > 0 " << std::endl;
+      exit(1);
+    }
     if (tester.get_output_utilization_all() ||
        tester.get_output_utilization())
       tester.set_output_statistics(true);