From: Sage Weil Date: Fri, 12 Jan 2018 23:39:18 +0000 (-0600) Subject: mon/OSDMonitor: fix 'osd crush set-device-class' for new osds X-Git-Tag: v12.2.4~11^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=02ec68dc6cbb96fdb963248a7b7b0c13e6ed0490;p=ceph.git 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 (cherry picked from commit 6aa7c885e57070c52ccecec1ceca9a53e878d30c) --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 180b6967e65f..518f60461177 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7782,6 +7782,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";