From: Loic Dachary Date: Tue, 23 Sep 2014 09:11:59 +0000 (+0200) Subject: erasure-code: restore jerasure BlaumRoth default w X-Git-Tag: v0.86~19^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2556%2Fhead;p=ceph.git erasure-code: restore jerasure BlaumRoth default w Changing from W=7 to W=6 by default for the BlaumRoth technique is correct but introduces a regression. The content that was encoded with the previous version cannot be read again. Although the prime(w+1) constraint was not obeyed by W=7, the encoded content was useable and should keep being readable. The W=7 remains the default for backward compatibility and an exception to the prime(w+1) check. http://tracker.ceph.com/issues/9572 Fixes: #9572 Signed-off-by: Loic Dachary --- diff --git a/src/erasure-code/jerasure/ErasureCodeJerasure.cc b/src/erasure-code/jerasure/ErasureCodeJerasure.cc index d48e0dbe44e30..4cac0a5f11ad5 100644 --- a/src/erasure-code/jerasure/ErasureCodeJerasure.cc +++ b/src/erasure-code/jerasure/ErasureCodeJerasure.cc @@ -454,6 +454,10 @@ void ErasureCodeJerasureLiberation::prepare() // bool ErasureCodeJerasureBlaumRoth::check_w(ostream *ss) const { + // back in Firefly, w = 7 was the default and produced useable + // chunks. Tolerate this value for backward compatibility. + if (w == 7) + return true; if (w <= 2 || !is_prime(w+1)) { *ss << "w=" << w << " must be greater than two and " << "w+1 must be prime" << std::endl; diff --git a/src/erasure-code/jerasure/ErasureCodeJerasure.h b/src/erasure-code/jerasure/ErasureCodeJerasure.h index 4a3b337a11b98..d40a03dec88ec 100644 --- a/src/erasure-code/jerasure/ErasureCodeJerasure.h +++ b/src/erasure-code/jerasure/ErasureCodeJerasure.h @@ -236,7 +236,6 @@ public: ErasureCodeJerasureBlaumRoth() : ErasureCodeJerasureLiberation("blaum_roth") { - DEFAULT_W = 6; } virtual bool check_w(ostream *ss) const;