]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix delayed pg creation use after free
authorSage Weil <sage@newdream.net>
Thu, 8 Jul 2010 20:34:15 +0000 (13:34 -0700)
committerSage Weil <sage@newdream.net>
Thu, 8 Jul 2010 20:34:15 +0000 (13:34 -0700)
Use local acting[], not the one stashed in creating_pgs[pgid].  And drop
the duplication .erase().

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc

index 27adee4adc560abc82b57b45b29df42ac18ae2b3..ac19f73b530ebe03b73409472502753b64036758 100644 (file)
@@ -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);