diff options
author | Kefu Chai <kchai@redhat.com> | 2018-11-14 09:33:04 +0100 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2018-11-15 07:34:03 +0100 |
commit | c3d13aab434c54fc0699aabf2a4a45662b53b3c2 (patch) | |
tree | cb125d7a451a7e74e5d20e1b35532282b506415f /src/erasure-code | |
parent | erasure-code: return error using `ss` not derr (diff) | |
download | ceph-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.cc | 2 |
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; |