]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #8941 from xiexingguo/xxg-wip-reweight-filter
authorYuri Weinstein <yuri.weinstein@gmail.com>
Thu, 26 May 2016 19:24:11 +0000 (12:24 -0700)
committerYuri Weinstein <yuri.weinstein@gmail.com>
Thu, 26 May 2016 19:24:11 +0000 (12:24 -0700)
mon/OSDMonitor: more fixes for reweight_by_* command

Reviewed-by: Kefu Chai <kchai@redhat.com>
1  2 
src/mon/OSDMonitor.cc

index e44e64a528724d6898d83586666bac54a59f57a2,3b080c2a944de63e642ac384222604801c14574a..dab13cc4d888b523e67e9a3ce3cdbb7b4e352860
@@@ -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;