]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: use upset rather than up for _update_calc_stats 10883/head
authorSamuel Just <sjust@redhat.com>
Thu, 11 Aug 2016 15:57:51 +0000 (08:57 -0700)
committerLoic Dachary <ldachary@redhat.com>
Fri, 26 Aug 2016 06:52:43 +0000 (08:52 +0200)
Fixes: http://tracker.ceph.com/issues/16998
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 200cae8c9db99b3dede377f74413cc0b15033e1f)

src/osd/PG.cc

index 69331a5243ac2c90aed83b7b6f5c302edb079c31..3b9d5a3cd9d0a2bdd90a7f5d7d4c402bde14e530 100644 (file)
@@ -2553,11 +2553,11 @@ void PG::_update_calc_stats()
 
     // a misplaced object is not stored on the correct OSD
     uint64_t misplaced = 0;
-    unsigned i = 0;
     unsigned in_place = 0;
-    for (vector<int>::iterator p = up.begin(); p != up.end(); ++p, ++i) {
-      pg_shard_t s(*p,
-                  pool.info.ec_pool() ? shard_id_t(i) : shard_id_t::NO_SHARD);
+    for (set<pg_shard_t>::const_iterator p = upset.begin();
+        p != upset.end();
+        ++p) {
+      const pg_shard_t &s = *p;
       if (actingset.count(s)) {
        ++in_place;
       } else {