From b0335e05ba9a54b01e3f2fa3aa32d8034e9e2113 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 7 Jul 2017 12:17:36 -0400 Subject: [PATCH] mon/OSDMonitor: guard 'osd crush set-device-class' Requires luminous. Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 032a42bb7e0..921b8f88199 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7060,6 +7060,12 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, goto update; } else if (prefix == "osd crush set-device-class") { + if (osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) { + ss << "you must complete the upgrade and set require_osd_release =" + << "luminous before using crush device classes"; + err = -EPERM; + goto reply; + } if (!osdmap.exists(osdid)) { err = -ENOENT; ss << name << " does not exist. create it before updating the crush map"; -- 2.39.5