]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/PGMonitor: MAX AVAIL is 0 if some OSDs' weight is 0 6907/head
authorChengyuan Li <chengyli@ebay.com>
Fri, 20 Nov 2015 05:29:39 +0000 (22:29 -0700)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Sat, 12 Dec 2015 13:39:44 +0000 (19:09 +0530)
commitb211686dddf35d990c07ea50b868b98ac3abf8d3
tree28bc816499713171465adba949f18086615f5250
parentf480cea217008fa7b1e476d30dcb13023e6431d1
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