]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: clear_pipe inside pipe_lock on mark_down_all
authorSage Weil <sage@inktank.com>
Mon, 17 Jun 2013 19:47:11 +0000 (12:47 -0700)
committerSage Weil <sage@inktank.com>
Wed, 24 Jul 2013 23:20:35 +0000 (16:20 -0700)
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 <sage@inktank.com>
(cherry picked from commit 5fc1dabfb3b2cbffdee3214d24d7769d6e440e45)

Conflicts:

src/msg/SimpleMessenger.cc

src/msg/SimpleMessenger.cc

index 148300f159c92b84e950925c1311afe44a5c7d35..dd6b1bd944bcde84b82f31181048822e92cc132b 100644 (file)
@@ -562,6 +562,8 @@ void SimpleMessenger::mark_down_all()
     p->unregister_pipe();
     p->pipe_lock.Lock();
     p->stop();
+    if (p->connection_state)
+      p->connection_state->clear_pipe(p);
     p->pipe_lock.Unlock();
   }
   lock.Unlock();