X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Ferasure-code%2Flrc%2FErasureCodeLrc.cc;h=bea861f1adee50b18d744ac0c8dfcb2f0b7ba89f;hb=20effc670b57271cb089376d6d0800990e5218d5;hp=b44eec469efc00b45fb0aa2ac10fbb107c2f5d1c;hpb=a71831dadd1e1f3e0fa70405511f65cc33db0498;p=ceph.git diff --git a/ceph/src/erasure-code/lrc/ErasureCodeLrc.cc b/ceph/src/erasure-code/lrc/ErasureCodeLrc.cc index b44eec469..bea861f1a 100644 --- a/ceph/src/erasure-code/lrc/ErasureCodeLrc.cc +++ b/ceph/src/erasure-code/lrc/ErasureCodeLrc.cc @@ -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;