This avoids putting all OSDs in both sets when the ratios are 0, as they
are with a fresh cluster and pgmap. This also makes setting the ratio to
0 effectively disable the full/nearfull feature.
Signed-off-by: Sage Weil <sage@newdream.net>
i != osd_stat.end();
++i) {
float ratio = ((float)i->second.kb_used) / ((float)i->second.kb);
- if ( ratio > full_ratio )
+ if (full_ratio > 0 && ratio > full_ratio)
full_osds.insert(i->first);
- else if ( ratio > nearfull_ratio )
+ else if (nearfull_ratio > 0 && ratio > nearfull_ratio)
nearfull_osds.insert(i->first);
}
}