]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon/PGMonitor: MAX AVAIL is 0 if some OSDs' weight is 0 6834/head
authorChengyuan Li <chengyli@ebay.com>
Fri, 20 Nov 2015 05:29:39 +0000 (22:29 -0700)
committerNathan Cutler <ncutler@suse.com>
Mon, 7 Dec 2015 22:26:02 +0000 (23:26 +0100)
commit61da13bbe271964c56116fb2bed51045290f951a
tree856c54ff63ab1cabfe4bb074ba63ffb1f98d622a
parentd06463604cb8daeda288e824e8812352c0d6a7d9
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