]> git.apps.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>
Sun, 23 Jun 2013 22:10:24 +0000 (15:10 -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>
src/msg/SimpleMessenger.cc

index f1e614628df1f9be5aae42294a9e01f20d115ee4..994f849c1eb21fd6c4b6a45b1adda3ca41e26d7c 100644 (file)
@@ -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();
 }