From f51d21b53d26d4f27c950cb1ba3f989e713ab325 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 23 Sep 2014 11:11:59 +0200 Subject: [PATCH] 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 --- src/erasure-code/jerasure/ErasureCodeJerasure.cc | 4 ++++ src/erasure-code/jerasure/ErasureCodeJerasure.h | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) 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; -- 2.47.3