From 6aa7c885e57070c52ccecec1ceca9a53e878d30c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 12 Jan 2018 17:39:18 -0600 Subject: [PATCH] mon/OSDMonitor: fix 'osd crush set-device-class' for new osds We should set the max_devices value for a new device. (Actually, finalize() will fix this for us on decode, but better to be pendantic.) Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index aea742fdc6c7a..139b2a6d6384f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7422,6 +7422,9 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, oss << "osd." << osd; string name = oss.str(); + if (newcrush.get_max_devices() < osd + 1) { + newcrush.set_max_devices(osd + 1); + } string action; if (newcrush.item_exists(osd)) { action = "updating"; -- 2.39.5