From: Kefu Chai Date: Mon, 12 Nov 2018 01:55:14 +0000 (+0800) Subject: tests: do not check for invalid k/m combinations X-Git-Tag: v14.1.0~905^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b13c7f7e9697be2d3a0188d185addea2553539e;p=ceph.git tests: do not check for invalid k/m combinations This reverts commit c5bafae6fd10282f408695c7763b1277469123f6. in 37f73607 and 3ec41030, we detect invalid "k". and we should always detect invalid combinations of parameters in ErasureCodeInterface::init(), and return -EINVAL instead of "autotune" them as put in the commit message of c5bafae6, if the profile is invalid for given erasure plugin. so ErasureCodeBench::encode() and ErasureCodeBench::decode() will bail out with the error message returned by ErasureCodeInterface::init() if the parameters are not valid. also, i checked all ErasureCodeInterface::init() implementations, none of them is overwriting the settings without returning a non-zero return code. so we are not overriding or autotuning the settings specified by user. Fixes: http://tracker.ceph.com/issues/16500 Signed-off-by: Kefu Chai --- diff --git a/src/test/erasure-code/ceph_erasure_code_benchmark.cc b/src/test/erasure-code/ceph_erasure_code_benchmark.cc index ccf1240fee00..4a810c7ebe32 100644 --- a/src/test/erasure-code/ceph_erasure_code_benchmark.cc +++ b/src/test/erasure-code/ceph_erasure_code_benchmark.cc @@ -161,15 +161,6 @@ int ErasureCodeBench::encode() return code; } - if (erasure_code->get_data_chunk_count() != (unsigned int)k || - (erasure_code->get_chunk_count() - erasure_code->get_data_chunk_count() - != (unsigned int)m)) { - cout << "parameter k is " << k << "/m is " << m << ". But data chunk count is " - << erasure_code->get_data_chunk_count() <<"/parity chunk count is " - << erasure_code->get_chunk_count() - erasure_code->get_data_chunk_count() << endl; - return -EINVAL; - } - bufferlist in; in.append(string(in_size, 'X')); in.rebuild_aligned(ErasureCode::SIMD_ALIGN); @@ -264,14 +255,7 @@ int ErasureCodeBench::decode() cerr << messages.str() << endl; return code; } - if (erasure_code->get_data_chunk_count() != (unsigned int)k || - (erasure_code->get_chunk_count() - erasure_code->get_data_chunk_count() - != (unsigned int)m)) { - cout << "parameter k is " << k << "/m is " << m << ". But data chunk count is " - << erasure_code->get_data_chunk_count() <<"/parity chunk count is " - << erasure_code->get_chunk_count() - erasure_code->get_data_chunk_count() << endl; - return -EINVAL; - } + bufferlist in; in.append(string(in_size, 'X')); in.rebuild_aligned(ErasureCode::SIMD_ALIGN);