summaryrefslogtreecommitdiffstats
path: root/src/erasure-code
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2018-11-14 09:33:04 +0100
committerKefu Chai <kchai@redhat.com>2018-11-15 07:34:03 +0100
commitc3d13aab434c54fc0699aabf2a4a45662b53b3c2 (patch)
treecb125d7a451a7e74e5d20e1b35532282b506415f /src/erasure-code
parenterasure-code: return error using `ss` not derr (diff)
downloadceph-c3d13aab434c54fc0699aabf2a4a45662b53b3c2.tar.xz
ceph-c3d13aab434c54fc0699aabf2a4a45662b53b3c2.zip
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 <kchai@redhat.com>
Diffstat (limited to 'src/erasure-code')
-rw-r--r--src/erasure-code/lrc/ErasureCodeLrc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/erasure-code/lrc/ErasureCodeLrc.cc b/src/erasure-code/lrc/ErasureCodeLrc.cc
index 2526774c38a..77e1eb98ff9 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;