]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: apply affinity if any affinity is not default 3618/head
authorKefu Chai <kchai@redhat.com>
Thu, 5 Feb 2015 04:34:42 +0000 (12:34 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 5 Feb 2015 05:52:17 +0000 (13:52 +0800)
src/osd/OSDMap.cc

index d4c45110cd4a1c9d2f6cf6ed9adc6c1f7515c3b4..e93040c33c0b253aab1549ea620ed9b240ddcabd 100644 (file)
@@ -1570,6 +1570,7 @@ void OSDMap::_apply_primary_affinity(ps_t seed,
     if (*p != CRUSH_ITEM_NONE &&
        (*osd_primary_affinity)[*p] != CEPH_OSD_DEFAULT_PRIMARY_AFFINITY) {
       any = true;
+      break;
     }
   }
   if (!any)
@@ -2370,7 +2371,7 @@ string OSDMap::get_flag_string(unsigned f)
   if (f & CEPH_OSDMAP_NOTIERAGENT)
     s += ",notieragent";
   if (s.length())
-    s = s.erase(0, 1);
+    s.erase(0, 1);
   return s;
 }