]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: do not check for invalid k/m combinations
authorKefu Chai <kchai@redhat.com>
Mon, 12 Nov 2018 01:55:14 +0000 (09:55 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Nov 2018 06:34:03 +0000 (14:34 +0800)
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 <kchai@redhat.com>
src/test/erasure-code/ceph_erasure_code_benchmark.cc

index ccf1240fee00fa5797d53565bf1e0fa4a8cd6b56..4a810c7ebe32faf8b948a6ab3f46bfbe44e9f534 100644 (file)
@@ -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);