]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code/lrc: error out if "l == 0" 25046/head
authorKefu Chai <kchai@redhat.com>
Wed, 14 Nov 2018 08:33:04 +0000 (16:33 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Nov 2018 06:34:03 +0000 (14:34 +0800)
l (locality) should not be 0, and k+m should be multiple of it

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/erasure-code/lrc/ErasureCodeLrc.cc

index 2526774c38ac30ecddb6175819178f4e8836e81d..77e1eb98ff9f725bca5a8c90ab6609f8871ac9fc 100644 (file)
@@ -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;