From c3d13aab434c54fc0699aabf2a4a45662b53b3c2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 14 Nov 2018 16:33:04 +0800 Subject: [PATCH] erasure-code/lrc: error out if "l == 0" l (locality) should not be 0, and k+m should be multiple of it Signed-off-by: Kefu Chai --- src/erasure-code/lrc/ErasureCodeLrc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/erasure-code/lrc/ErasureCodeLrc.cc b/src/erasure-code/lrc/ErasureCodeLrc.cc index 2526774c38ac..77e1eb98ff9f 100644 --- a/src/erasure-code/lrc/ErasureCodeLrc.cc +++ b/src/erasure-code/lrc/ErasureCodeLrc.cc @@ -324,7 +324,7 @@ int ErasureCodeLrc::parse_kml(ErasureCodeProfile &profile, } } - if ((k + m) % l) { + if (l == 0 || (k + m) % l) { *ss << "k + m must be a multiple of l in " << profile << std::endl; return ERROR_LRC_K_M_MODULO; -- 2.47.3