From: Kefu Chai Date: Fri, 23 Sep 2016 06:20:37 +0000 (+0800) Subject: osd: should not look up an empty pg X-Git-Tag: v11.0.1~112^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=48e29fb8e50f97b73bff6b7175215b65a4ab5c68;p=ceph.git osd: should not look up an empty pg this fixes the scrub timeouts we spotted in jenkins run and qa run. it's a regression introduced by c2b7cdb Fixes: http://tracker.ceph.com/issues/17380 Signed-off-by: Loic Dachary Signed-off-by: Kefu Chai --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 09924c9a5ab1..bc18041bf69e 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -6377,10 +6377,12 @@ void OSD::handle_scrub(MOSDScrub *m) p != m->scrub_pgs.end(); ++p) { spg_t pcand; - auto pg_map_entry = pg_map.find(pcand); - if (osdmap->get_primary_shard(*p, &pcand) && - pg_map_entry != pg_map.end()) - handle_pg_scrub(m, pg_map_entry->second); + if (osdmap->get_primary_shard(*p, &pcand)) { + auto pg_map_entry = pg_map.find(pcand); + if (pg_map_entry != pg_map.end()) { + handle_pg_scrub(m, pg_map_entry->second); + } + } } }