]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: disconnect_session_watches: handle race with watch disconnect
authorSamuel Just <sam.just@inktank.com>
Tue, 26 Jun 2012 17:38:20 +0000 (10:38 -0700)
committerSage Weil <sage@inktank.com>
Wed, 27 Jun 2012 14:10:32 +0000 (07:10 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Tested-by: Stefan Priebe <s.priebe@profihost.ag>
src/osd/OSD.cc

index 3cd6bd7e9198804fca535af016d02f4425513b85..3cba75641d0828663a2910f227b3ae3e402c00ba 100644 (file)
@@ -2028,6 +2028,7 @@ void OSD::disconnect_session_watches(Session *session)
        dout(10) << " disconnected watch " << w << " by " << entity << " session " << session
                 << ", expires " << expire << dendl;
         obc->watchers.erase(witer++);
+       pg->put_object_context(obc);
        session->put();
       }
       if (witer == obc->watchers.end())
@@ -2035,8 +2036,6 @@ void OSD::disconnect_session_watches(Session *session)
       ++witer;
     }
     watch_lock.Unlock();
-    pg->put_object_context(obc);
-    /* now drop a reference to that obc */
     pg->unlock();
   }
 }