From 10b8966c8da38f8ae5ac7dbb2e16a5e45e502ba3 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 16 Sep 2014 20:29:12 +0200 Subject: [PATCH] crushtool: safeguard for missing --num-rep when --test http://tracker.ceph.com/issues/9490 Fixes: #9490 Signed-off-by: Loic Dachary --- src/tools/crushtool.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index ccb0efda74a7..10adc11a4954 100644 --- a/src/tools/crushtool.cc +++ b/src/tools/crushtool.cc @@ -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); -- 2.47.3