]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: upmap: fix bug
authorSage Weil <sage@redhat.com>
Mon, 1 May 2017 23:14:53 +0000 (18:14 -0500)
committerSage Weil <sage@redhat.com>
Mon, 1 May 2017 23:14:53 +0000 (18:14 -0500)
Use deviation for this item, not the max deviation.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSDMap.cc

index 1f69ac706444e17241bfa245429ee71e38e766fc..278457dbcd7d4b844b032cf2b75f1cbd1d0fb9c0 100644 (file)
@@ -3502,8 +3502,8 @@ int OSDMap::calc_pg_upmaps(
     bool restart = false;
     for (auto p = deviation_osd.rbegin(); p != deviation_osd.rend(); ++p) {
       int osd = p->second;
+      float deviation = p->first;
       float target = osd_weight[osd] * pgs_per_weight;
-      float deviation = deviation_osd.rbegin()->first;
       if (deviation/target < max_deviation) {
        ldout(cct, 10) << " osd." << osd
                       << " target " << target