From f456b51d60b4609152db533304bcbcf3b968c506 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 8 Jul 2010 13:34:15 -0700 Subject: [PATCH] osd: fix delayed pg creation use after free Use local acting[], not the one stashed in creating_pgs[pgid]. And drop the duplication .erase(). Signed-off-by: Sage Weil --- src/osd/OSD.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 27adee4adc560..ac19f73b530eb 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -820,6 +820,7 @@ PG *OSD::_open_lock_pg(pg_t pgid, bool no_lockdep_check) { assert(osd_lock.is_locked()); + dout(10) << "_open_lock_pg " << pgid << dendl; PGPool *pool = _get_pool(pgid.pool()); // create @@ -3329,8 +3330,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m) t = new ObjectStore::Transaction; fin = new C_Contexts; if (create) { - pg = _create_lock_new_pg(pgid, creating_pgs[pgid].acting, *t); - creating_pgs.erase(pgid); + pg = _create_lock_new_pg(pgid, acting, *t); } else { pg = _create_lock_pg(pgid, *t); pg->acting.swap(acting); -- 2.39.5