From c3dc6a6ebf0fc42dad3989a7e0f8a4184f93d396 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 26 Mar 2012 12:36:06 -0700 Subject: [PATCH] msg: assert pipe->msgr == msgr Fixes: #2216 Signed-off-by: Sage Weil --- src/msg/SimpleMessenger.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index 8f644f9492e47..a1e1cc4edc799 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -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; -- 2.39.5