From: Loic Dachary Date: Tue, 27 May 2014 16:36:09 +0000 (+0200) Subject: erasure-code: cauchy techniques allow w 8,16,32 X-Git-Tag: v0.85~100^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3987ac2a418870fb51411f21c98925518bf2cb01;p=ceph.git erasure-code: cauchy techniques allow w 8,16,32 Enforce the restriction at initialization time, the same way it is done for Reed Solomon. Choosing a w value different from 8,16,32 will lead to memory corruption that cannot easily be traced to the cause. Signed-off-by: Loic Dachary --- diff --git a/src/erasure-code/jerasure/ErasureCodeJerasure.cc b/src/erasure-code/jerasure/ErasureCodeJerasure.cc index ed2e583a5b269..3fa1f6cdb446c 100644 --- a/src/erasure-code/jerasure/ErasureCodeJerasure.cc +++ b/src/erasure-code/jerasure/ErasureCodeJerasure.cc @@ -255,8 +255,8 @@ void ErasureCodeJerasureReedSolomonVandermonde::parse(const map ¶me k = to_int("k", parameters, DEFAULT_K); m = to_int("m", parameters, DEFAULT_M); w = to_int("w", parameters, DEFAULT_W); + if (w != 8 && w != 16 && w != 32) { + derr << "Cauchy: w=" << w + << " must be one of {8, 16, 32} : revert to " + << DEFAULT_W << dendl; + w = DEFAULT_W; + } packetsize = to_int("packetsize", parameters, DEFAULT_PACKETSIZE); }