]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: use upset rather than up for _update_calc_stats 11933/head
authorSamuel Just <sjust@redhat.com>
Thu, 11 Aug 2016 15:57:51 +0000 (08:57 -0700)
committerNathan Cutler <ncutler@suse.com>
Sat, 12 Nov 2016 10:54:12 +0000 (11:54 +0100)
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 b8e7f274a8b2d2f898617f6a2de8ab2b880585e9..509f33628aa1b13d8a756cc4079a007865d016cb 100644 (file)
@@ -2414,11 +2414,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 {