]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd pg locking fix
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 19 Jul 2007 16:43:59 +0000 (16:43 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 19 Jul 2007 16:43:59 +0000 (16:43 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1530 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/osd/OSD.cc

index f7aa65a29b93b8d16e601e11b711a477750f0bcd..309fa35c0a86421219a231607a1678d03e48014c 100644 (file)
@@ -1579,7 +1579,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m)
     pg_t pgid = it->pgid;
     PG *pg;
 
-    if (pg_map.count(pgid) == 0) {
+    if (!_have_pg(pgid)) {
       // same primary?
       PG::Info::History history = it->history;
       project_pg_history(pgid, history, m->get_epoch());
@@ -1610,7 +1610,7 @@ void OSD::handle_pg_notify(MOSDPGNotify *m)
       }
     } else {
       // already had it.  am i (still) the primary?
-      pg->lock();
+      pg = _lookup_lock_pg(pgid);
       if (m->get_epoch() < pg->info.history.same_primary_since) {
         dout(10) << *pg << " handle_pg_notify primary changed in "
                  << pg->info.history.same_primary_since