]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/OSDMonitor: fix potential division-by-zero error
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 15 Aug 2016 08:40:11 +0000 (16:40 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 18 Aug 2016 10:05:40 +0000 (18:05 +0800)
commitc309ba49df08eaa84673ad50bf75f055e7dbabc7
tree49499a0cf6262aa0860f05ddf7ecd5d42609b129
parentea63a4e1841f14d76e610993bd7c1ee6c21771aa
mon/OSDMonitor: fix potential division-by-zero error

By checking pg_num against 0, we could avoid the risk of
division-by-zero error.

Also, we limit the loop to 50 or pg_num, whichever is smaller,
when trying to generate some pg_temps randomly.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/mon/OSDMonitor.cc