]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Pipe::stop_and_wait: unlock pipe_lock for stop_fast_dispatching() 12307/head
authorSamuel Just <sjust@redhat.com>
Tue, 29 Nov 2016 20:30:30 +0000 (12:30 -0800)
committerSamuel Just <sjust@redhat.com>
Tue, 29 Nov 2016 20:30:44 +0000 (12:30 -0800)
OSD::ms_fast_dispatch may need the pipe_lock to finish what it's
doing and avoid a deadlock.

Fixes: http://tracker.ceph.com/issues/18042
Signed-off-by: Samuel Just <sjust@redhat.com>
src/msg/simple/Pipe.cc

index c57790d05664a3986f24758d7ca06253f65b5169..5edec546bee5c44950f261adcd1c476b3b6d6c49 100644 (file)
@@ -1561,6 +1561,7 @@ void Pipe::stop()
 
 void Pipe::stop_and_wait()
 {
+  assert(pipe_lock.is_locked_by_me());
   if (state != STATE_CLOSED)
     stop();
 
@@ -1574,7 +1575,9 @@ void Pipe::stop_and_wait()
   }
   
   if (delay_thread) {
+    pipe_lock.Unlock();
     delay_thread->stop_fast_dispatching();
+    pipe_lock.Lock();
   }
   while (reader_running &&
         reader_dispatching)