]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix 'osd crush add ..' weight
authorSage Weil <sage.weil@dreamhost.com>
Sat, 12 Nov 2011 22:04:15 +0000 (14:04 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 12 Nov 2011 22:08:02 +0000 (14:08 -0800)
This was changed to floating point in commit 3f67893.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mon/OSDMonitor.cc

index 15186a0e0ce2d238960ffc70b7ed0458b18efda4..a2b6d5f83dda8aa1a2d519f6c703aa43b8e471c3 100644 (file)
@@ -1503,9 +1503,7 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
        bufferlist::iterator p = bl.begin();
        newcrush.decode(p);
 
-       if (id >= newcrush.get_max_devices())
-         newcrush.set_max_devices(id + 1);
-       err = newcrush.insert_item(id, (int)(weight * (float)0x10000), name, loc);
+       err = newcrush.insert_item(id, weight, name, loc);
        if (err == 0) {
          if (newcrush.get_max_devices() > osdmap.get_max_osd()) {
            err = -ERANGE;