]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mon/PGMonitor: MAX AVAIL is 0 if some OSDs' weight is 0
authorChengyuan Li <chengyli@ebay.com>
Fri, 20 Nov 2015 05:29:39 +0000 (22:29 -0700)
committerSage Weil <sage@redhat.com>
Sun, 29 Nov 2015 14:28:48 +0000 (09:28 -0500)
commit06b3b47ebca16b8383b3dca047281e1477a48106
tree59925ce7813494993974f5f9819402a32f4d8c48
parentb2eefcac07b70d257566c3a4d909dfb3df421a79
mon/PGMonitor: MAX AVAIL is 0 if some OSDs' weight is 0

In get_rule_avail(), even p->second is 0, it's possible to be used
as divisor and quotient is infinity, then is converted to an integer
which is negative value.
So we should check p->second value before calculation.

It fixes BUG #13840.

Signed-off-by: Chengyuan Li <chengyli@ebay.com>
(cherry picked from commit 18713e60edd1fe16ab571f7c83e6de026db483ca)
src/mon/PGMonitor.cc