Fixes: http://tracker.ceph.com/issues/15655
Signed-off-by: Samuel Just <sjust@redhat.com>
// to represent e.g. differing storage capacities
unsigned weight = osdmap.get_weight(p->first);
unsigned new_weight = (unsigned)((average_util / util) * (float)weight);
- new_weight = MAX(new_weight, weight - max_change);
+ if (weight > max_change)
+ new_weight = MAX(new_weight, weight - max_change);
newinc.new_weight[p->first] = new_weight;
if (!dry_run) {
pending_inc.new_weight[p->first] = new_weight;