OSD: pg might be removed during disconnect_session_watches

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>
This commit is contained in:
Samuel Just 2012-12-12 15:09:25 -08:00
parent 047aecd90f
commit dba096073a

View 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