From 5fc1dabfb3b2cbffdee3214d24d7769d6e440e45 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 17 Jun 2013 12:47:11 -0700 Subject: [PATCH] msgr: clear_pipe inside pipe_lock on mark_down_all Observed a segfault in rebind -> mark_down_all -> clear_pipe -> put that may have been due to a racing thread clearing the connection_state pointer. Do the clear_pipe() call under the protection of pipe_lock, as we do in all other contexts. Signed-off-by: Sage Weil --- src/msg/SimpleMessenger.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index f1e614628df1f..994f849c1eb21 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -563,9 +563,9 @@ void SimpleMessenger::mark_down_all() p->pipe_lock.Lock(); p->stop(); ConnectionRef con = p->connection_state; - p->pipe_lock.Unlock(); if (con && con->clear_pipe(p)) dispatch_queue.queue_reset(con.get()); + p->pipe_lock.Unlock(); } lock.Unlock(); } -- 2.39.5