From: Sage Weil Date: Tue, 7 Feb 2017 19:00:32 +0000 (-0500) Subject: mon: prevent sortbitwise flag from being unset X-Git-Tag: v12.0.1~469^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8226159e7ca67e0aea922974cd40e29d62fc504d;p=ceph-ci.git mon: prevent sortbitwise flag from being unset Signed-off-by: Sage Weil --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 03a8813faa4..7df68e7c7f4 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -1102,12 +1102,12 @@ function test_mon_osd() ceph osd deep-scrub 0 ceph osd repair 0 - for f in noup nodown noin noout noscrub nodeep-scrub nobackfill norebalance norecover notieragent full sortbitwise + for f in noup nodown noin noout noscrub nodeep-scrub nobackfill norebalance norecover notieragent full do ceph osd set $f ceph osd unset $f done - ceph osd set sortbitwise # new backends cant handle nibblewise + expect_false ceph osd unset sortbitwise # cannot be unset expect_false ceph osd set bogus expect_false ceph osd unset bogus ceph osd set require_jewel_osds diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index a2962c45e6f..769dbbc8df3 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -652,7 +652,7 @@ COMMAND("osd set " \ "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise|require_jewel_osds|require_kraken_osds", \ "set ", "osd", "rw", "cli,rest") COMMAND("osd unset " \ - "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent|sortbitwise", \ + "name=key,type=CephChoices,strings=full|pause|noup|nodown|noout|noin|nobackfill|norebalance|norecover|noscrub|nodeep-scrub|notieragent", \ "unset ", "osd", "rw", "cli,rest") COMMAND("osd cluster_snap", "take cluster snapshot (disabled)", \ "osd", "r", "") diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 585cd7bf0fc..6013bd2422a 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -6512,9 +6512,10 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, return prepare_unset_flag(op, CEPH_OSDMAP_NODEEP_SCRUB); else if (key == "notieragent") return prepare_unset_flag(op, CEPH_OSDMAP_NOTIERAGENT); - else if (key == "sortbitwise") - return prepare_unset_flag(op, CEPH_OSDMAP_SORTBITWISE); - else { + else if (key == "sortbitwise") { + ss << "the sortbitwise flag is required and cannot be unset"; + err = -EPERM; + } else { ss << "unrecognized flag '" << key << "'"; err = -EINVAL; }