From: Yuri Weinstein Date: Thu, 26 May 2016 19:24:11 +0000 (-0700) Subject: Merge pull request #8941 from xiexingguo/xxg-wip-reweight-filter X-Git-Tag: v11.0.0~401 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6deb14209c42c290448eba1daaacc2cfdbf67a2;p=ceph.git Merge pull request #8941 from xiexingguo/xxg-wip-reweight-filter mon/OSDMonitor: more fixes for reweight_by_* command Reviewed-by: Kefu Chai --- c6deb14209c42c290448eba1daaacc2cfdbf67a2 diff --cc src/mon/OSDMonitor.cc index e44e64a52872,3b080c2a944d..dab13cc4d888 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@@ -537,9 -540,10 +541,9 @@@ int OSDMonitor::reweight_by_utilization average_util = (double)num_pg_copies / weight_sum; } else { // by osd utilization - int num_osd = MIN(1, pgm.osd_stat.size()); + int num_osd = MAX(1, pgm.osd_stat.size()); if ((uint64_t)pgm.osd_sum.kb * 1024 / num_osd < g_conf->mon_reweight_min_bytes_per_osd) { - ostringstream oss; *ss << "Refusing to reweight: we only have " << pgm.osd_sum.kb << " kb across all osds!\n"; return -EDOM;