linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mandeep Singh Baines <msb@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: Mandeep Singh Baines <msb@chromium.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Neil Horman <nhorman@tuxdriver.com>,
	Earl Chew <earl_chew@agilent.com>,
	Oleg Nesterov <oleg@redhat.com>, Andi Kleen <andi@firstfloor.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH] exec: log when wait_for_dump_helpers aborts due to a signal
Date: Tue, 25 Oct 2011 18:07:08 -0700	[thread overview]
Message-ID: <1319591228-20397-1-git-send-email-msb@chromium.org> (raw)

To allow coredump pipe readers to look at /proc/<pid> of the crashing
process, the kernel waits for the reader to exit. However, the wait
is silently aborted if the crashing process is signalled.

This patch, logs whenever wait_for_dump_helpers is aborted or in order
to assist in debugging cases where /proc/<pid> is gone.

Alternatively, we may want to consider not aborting on a signal. You
could always break the loop by killing the reader process.

Reference: http://crosbug.com/21559
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Earl Chew <earl_chew@agilent.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org
---
 fs/exec.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 25dcbe5..5d4190d 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2030,7 +2030,14 @@ static void wait_for_dump_helpers(struct file *file)
 	pipe->readers++;
 	pipe->writers--;
 
-	while ((pipe->readers > 1) && (!signal_pending(current))) {
+	while (pipe->readers > 1) {
+		if (signal_pending(current)) {
+			pr_info("wait_for_dump_helpers[%d]: "
+				"aborted due to signal\n",
+				task_pid_nr(current));
+			break;
+		}
+
 		wake_up_interruptible_sync(&pipe->wait);
 		kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
 		pipe_wait(pipe);
-- 
1.7.3.1

             reply	other threads:[~2011-10-26  1:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26  1:07 Mandeep Singh Baines [this message]
2011-10-26 16:54 ` [PATCH] exec: log when wait_for_dump_helpers aborts due to a signal Oleg Nesterov
2011-10-28 23:26 ` Andrew Morton
2011-10-29 12:42   ` Neil Horman
2011-10-29 14:43   ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319591228-20397-1-git-send-email-msb@chromium.org \
    --to=msb@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andi@firstfloor.org \
    --cc=earl_chew@agilent.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=oleg@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).