summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2012-12-12 15:09:25 -0800
committerSamuel Just <sam.just@inktank.com>2012-12-12 15:30:04 -0800
commitdba096073ab0dbc35ec214b4c12d5f0e11f14489 (patch)
tree653d8f0a25a2425fd2e1e95780bd5e5018aead77
parent047aecd90f1dbfb172f48f9d10b67e82b3a8ce15 (diff)
downloadceph-dba096073ab0dbc35ec214b4c12d5f0e11f14489.tar.gz
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>
-rw-r--r--src/osd/OSD.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index 92092969ea0..ea96c327ba2 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -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