From 17f433aa569a437638edd1decadd2fbc9f4878ef Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 26 Jun 2012 10:38:20 -0700 Subject: [PATCH] OSD: disconnect_session_watches: handle race with watch disconnect Signed-off-by: Samuel Just Reviewed-by: Sage Weil Tested-by: Stefan Priebe --- src/osd/OSD.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 3cd6bd7e91988..3cba75641d082 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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(); } } -- 2.39.5