Fixes: #10257
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
(cherry picked from commit
b311e7c36273efae39aa2602c1f8bd90d39e5975)
Conflicts:
src/mon/PGMonitor.cc
ceph::unordered_map changed the context, simple resolution
return 0;
int64_t min = -1;
for (map<int,float>::iterator p = wm.begin(); p != wm.end(); ++p) {
+ if (pg_map.osd_stat[p->first].kb == 0) {
+ // osd must be out, hence its stats have been zeroed
+ // (unless we somehow managed to have a disk with size 0...)
+ continue;
+ }
int64_t proj = (float)(pg_map.osd_stat[p->first].kb_avail * 1024ull) /
(double)p->second;
if (min < 0 || proj < min)