]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: if crush rule create-simple exists return
authorLoic Dachary <loic@dachary.org>
Sun, 9 Feb 2014 11:31:30 +0000 (12:31 +0100)
committerLoic Dachary <loic@dachary.org>
Thu, 13 Feb 2014 11:14:05 +0000 (12:14 +0100)
And it is consistent with the above. Also use a slightly different
string to allow the caller to differentiate between the two cases.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/mon/OSDMonitor.cc

index eea7bcb7d6a104cb827a0859a29d5481addf0daa..93ebc2bc28c406d61dd4426953e600b2070eb717 100644 (file)
@@ -3704,6 +3704,7 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
     if (newcrush.rule_exists(name)) {
       ss << "rule " << name << " already exists";
       err = 0;
+      goto reply;
     } else {
       int rule = newcrush.add_simple_ruleset(name, root, type, mode,
                                             pg_pool_t::TYPE_REPLICATED, &ss);