]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: fix 'osd crush set-device-class' for new osds
authorSage Weil <sage@redhat.com>
Fri, 12 Jan 2018 23:39:18 +0000 (17:39 -0600)
committerSage Weil <sage@redhat.com>
Mon, 12 Feb 2018 17:18:10 +0000 (11:18 -0600)
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 <sage@redhat.com>
(cherry picked from commit 6aa7c885e57070c52ccecec1ceca9a53e878d30c)

src/mon/OSDMonitor.cc

index 180b6967e65fa3e314839ca12d36886c2515d6c6..518f60461177bc79029a045c685e9ccfc0919b11 100644 (file)
@@ -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";