VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Oleg Nesterov <oleg@redhat.com> 2013-04-30 15:28:17 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2013-04-30 17:04:06 -0700 commit: dc7ee2aac830e5423f41de87d50441f138f648da parent: 079148b919d0c58b796f9ae98bdb53028dbcd5e7
Commit Summary:
coredump: change wait_for_dump_helpers() to use wait_event_interruptible()
Diffstat:
1 file changed, 9 insertions, 6 deletions
diff --git a/fs/coredump.c b/fs/coredump.c
index 7300e312fb3a..ec306cc9a28a 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -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);
-
 }
 
 /*