]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/erasure-code/lrc/ErasureCodeLrc.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / erasure-code / lrc / ErasureCodeLrc.cc
index b44eec469efc00b45fb0aa2ac10fbb107c2f5d1c..bea861f1adee50b18d744ac0c8dfcb2f0b7ba89f 100644 (file)
@@ -71,16 +71,13 @@ int ErasureCodeLrc::create_rule(const string &name,
 
   int rno = 0;
   for (rno = 0; rno < crush.get_max_rules(); rno++) {
-    if (!crush.rule_exists(rno) && !crush.ruleset_exists(rno))
+    if (!crush.rule_exists(rno))
        break;
   }
 
   int steps = 4 + rule_steps.size();
-  int min_rep = 3;
-  int max_rep = get_chunk_count();
   int ret;
-  ret = crush.add_rule(rno, steps, pg_pool_t::TYPE_ERASURE,
-                      min_rep, max_rep);
+  ret = crush.add_rule(rno, steps, pg_pool_t::TYPE_ERASURE);
   ceph_assert(ret == rno);
   int step = 0;
 
@@ -406,7 +403,9 @@ int ErasureCodeLrc::parse_rule(ErasureCodeProfile &profile,
   err |= to_string("crush-device-class", profile,
                   &rule_device_class,
                   "", ss);
-
+  if (err) {
+    return err;
+  }
   if (profile.count("crush-steps") != 0) {
     rule_steps.clear();
     string str = profile.find("crush-steps")->second;