From: xie xingguo Date: Mon, 10 Jul 2017 03:25:53 +0000 (+0800) Subject: mon/OSDMonitor: guard "osd crush rule create-replicated" X-Git-Tag: v12.1.1~81^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6223dc9185a8baff70f7797b25eed832357e9450;p=ceph.git mon/OSDMonitor: guard "osd crush rule create-replicated" require Luminous before using the crush device classes. Signed-off-by: xie xingguo --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 467c84cfcf1d..86657e3a9fd3 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7859,6 +7859,15 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, cmd_getval(g_ceph_context, cmdmap, "type", type); cmd_getval(g_ceph_context, cmdmap, "class", device_class); + if (!device_class.empty()) { + if (osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) { + ss << "you must complete the upgrade and 'ceph osd require-osd-release " + << "luminous' before using crush device classes"; + err = -EPERM; + goto reply; + } + } + if (osdmap.crush->rule_exists(name)) { // The name is uniquely associated to a ruleid and the rule it contains // From the user point of view, the rule is more meaningfull.