]> 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>
Tue, 16 Jan 2018 15:55:10 +0000 (09:55 -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>
src/mon/OSDMonitor.cc

index aea742fdc6c7a912f0a531c0530be68c2506ee82..139b2a6d6384f3f221c3a406483b96bcd3bbc497 100644 (file)
@@ -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";