]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: assert pipe->msgr == msgr
authorSage Weil <sage@newdream.net>
Mon, 26 Mar 2012 19:36:06 +0000 (12:36 -0700)
committerSage Weil <sage@newdream.net>
Mon, 26 Mar 2012 19:40:18 +0000 (12:40 -0700)
Fixes: #2216
Signed-off-by: Sage Weil <sage@newdream.net>
src/msg/SimpleMessenger.cc

index 8f644f9492e478532dcd5700685c69f9a815f550..a1e1cc4edc7991868495d841482735ec0c77999b 100644 (file)
@@ -2469,6 +2469,7 @@ bool SimpleMessenger::verify_authorizer(Connection *con, int peer_type,
 
 void SimpleMessenger::submit_message(Message *m, Pipe *pipe)
 { 
+  assert(pipe->msgr == this);
   lock.Lock();
   if (pipe == dispatch_queue.local_pipe) {
     ldout(cct,20) << "submit_message " << *m << " local" << dendl;
@@ -2629,6 +2630,7 @@ int SimpleMessenger::send_keepalive(Connection *con)
   SimpleMessenger::Pipe *pipe = (SimpleMessenger::Pipe *)con->get_pipe();
   if (pipe) {
     ldout(cct,20) << "send_keepalive con " << con << ", have pipe." << dendl;
+    assert(pipe->msgr == this);
     pipe->pipe_lock.Lock();
     pipe->_send_keepalive();
     pipe->pipe_lock.Unlock();
@@ -2750,6 +2752,7 @@ void SimpleMessenger::mark_down(Connection *con)
   Pipe *p = (Pipe *)con->get_pipe();
   if (p) {
     ldout(cct,1) << "mark_down " << con << " -- " << p << dendl;
+    assert(p->msgr == this);
     p->unregister_pipe();
     p->pipe_lock.Lock();
     p->stop();
@@ -2766,6 +2769,7 @@ void SimpleMessenger::mark_down_on_empty(Connection *con)
   lock.Lock();
   Pipe *p = (Pipe *)con->get_pipe();
   if (p) {
+    assert(p->msgr == this);
     p->pipe_lock.Lock();
     p->unregister_pipe();
     if (p->out_q.empty()) {
@@ -2789,6 +2793,7 @@ void SimpleMessenger::mark_disposable(Connection *con)
   Pipe *p = (Pipe *)con->get_pipe();
   if (p) {
     ldout(cct,1) << "mark_disposable " << con << " -- " << p << dendl;
+    assert(p->msgr == this);
     p->pipe_lock.Lock();
     p->policy.lossy = true;
     p->disposable = true;