From: Kefu Chai Date: Wed, 14 Nov 2018 08:33:04 +0000 (+0800) Subject: erasure-code/lrc: error out if "l == 0" X-Git-Tag: v14.1.0~905^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F25046%2Fhead;p=ceph.git 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 --- 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;