]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/coredump.c
coredump: change wait_for_dump_helpers() to use wait_event_interruptible()
[karo-tx-linux.git] / fs / coredump.c
index 7300e312fb3a2b3882dc1deb8339e3feb453c358..ec306cc9a28acf6804ea8b974ddf445f25450109 100644 (file)
@@ -439,17 +439,20 @@ static void wait_for_dump_helpers(struct file *file)
        pipe_lock(pipe);
        pipe->readers++;
        pipe->writers--;
+       wake_up_interruptible_sync(&pipe->wait);
+       kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
+       pipe_unlock(pipe);
 
-       while ((pipe->readers > 1) && (!signal_pending(current))) {
-               wake_up_interruptible_sync(&pipe->wait);
-               kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
-               pipe_wait(pipe);
-       }
+       /*
+        * We actually want wait_event_freezable() but then we need
+        * to clear TIF_SIGPENDING and improve dump_interrupted().
+        */
+       wait_event_interruptible(pipe->wait, pipe->readers == 1);
 
+       pipe_lock(pipe);
        pipe->readers--;
        pipe->writers++;
        pipe_unlock(pipe);
-
 }
 
 /*