From e302e636b8fd8f3106a3971dfc44f2c91995e3f5 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 11 Aug 2016 08:57:51 -0700 Subject: [PATCH] PG: use upset rather than up for _update_calc_stats Fixes: http://tracker.ceph.com/issues/16998 Signed-off-by: Samuel Just (cherry picked from commit 200cae8c9db99b3dede377f74413cc0b15033e1f) --- src/osd/PG.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b8e7f274a8b2d..509f33628aa1b 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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::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::const_iterator p = upset.begin(); + p != upset.end(); + ++p) { + const pg_shard_t &s = *p; if (actingset.count(s)) { ++in_place; } else { -- 2.39.5