By definition, we should only upmap pgs from overfull osds to
underfull osds. Hence we could make a safe exit if we start
to hit underfull osds when searching a target osd for upmapping.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
}
int osd = p->second;
float deviation = p->first;
+ if (deviation < 0) {
+ ldout(cct, 10) << " hitting underfull osds now"
+ << " when trying to remap overfull osds"
+ << dendl;
+ break;
+ }
float target = osd_weight[osd] * pgs_per_weight;
ldout(cct, 10) << " Overfull search osd." << osd
<< " target " << target