]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: pg might be removed during disconnect_session_watches
authorSamuel Just <sam.just@inktank.com>
Wed, 12 Dec 2012 23:09:25 +0000 (15:09 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 12 Dec 2012 23:30:04 +0000 (15:30 -0800)
We don't hold the osd_lock between the session->watches traversal
and the obc checks.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/OSD.cc

index 92092969ea09891595477de4d6a81b9df404800d..ea96c327ba2f1aab446dc3e3827e854c9888b8c5 100644 (file)
@@ -2431,7 +2431,12 @@ void OSD::disconnect_session_watches(Session *session)
     dout(10) << "obc=" << (void *)obc << dendl;
 
     ReplicatedPG *pg = static_cast<ReplicatedPG *>(lookup_lock_raw_pg(oiter->second));
-    assert(pg);
+    if (!pg) {
+      /* pg removed between watch_unlock.Unlock() and now, all related
+       * watch structures would have been cleaned up in remove_watchers_and_notifies
+       */
+      continue; 
+    }
     service.watch_lock.Lock();
     /* NOTE! fix this one, should be able to just lookup entity name,
        however, we currently only keep EntityName on the session and not