mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Scott James Remnant <scott@netsplit.com>
Cc: linux-kernel@vger.kernel.org,
	Mandeep Singh Baines <msb@chromium.org>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH] coredump: wait on the core pattern umh at least once
Date: Fri, 28 Oct 2011 16:22:16 -0400	[thread overview]
Message-ID: <20111028202216.GA21504@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1319832688-30336-1-git-send-email-scott@netsplit.com>

On Fri, Oct 28, 2011 at 01:11:28PM -0700, Scott James Remnant wrote:
> If a thread crashes as a result of a signal on the thread group leader
> that signal can still be pending, which means the loop in
> wait_for_dump_helpers() falls straight though.
> 
> This can mean that the crashing process is reaped before any core
> pattern user-mode helper is run, leaving it without entries in /proc
> to look through.
> 
> While the helper obviously has to deal with that, tweaking this loop
> so it runs at least one iteration even in that case helps a lot.
> 
> Signed-off-by: Scott James Remnant <scott@netsplit.com>
> ---
>  fs/exec.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/exec.c b/fs/exec.c
> index 25dcbe5..8959d304 100644
> --- a/fs/exec.c
> +++ b/fs/exec.c
> @@ -2030,11 +2030,11 @@ static void wait_for_dump_helpers(struct file *file)
>  	pipe->readers++;
>  	pipe->writers--;
>  
> -	while ((pipe->readers > 1) && (!signal_pending(current))) {
> +	do {
>  		wake_up_interruptible_sync(&pipe->wait);
>  		kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
>  		pipe_wait(pipe);
> -	}
> +	} while ((pipe->readers > 1) && (!signal_pending(current)));
>  
>  	pipe->readers--;
>  	pipe->writers++;
> -- 
> 1.7.3.1
> 
> 
Seems reasonable to me.
Acked-by: Neil Horman <nhorman@tuxdriver.com>


  reply	other threads:[~2011-10-28 20:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 20:11 Scott James Remnant
2011-10-28 20:22 ` Neil Horman [this message]
2011-10-28 21:16   ` Scott James Remnant
2011-10-29 14:13 ` Oleg Nesterov
2011-10-29 18:01   ` Scott James Remnant
2011-10-29 19:30     ` Oleg Nesterov
2011-10-29 19:38       ` Scott James Remnant
2011-10-31 21:18     ` Neil Horman

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=20111028202216.GA21504@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msb@chromium.org \
    --cc=oleg@redhat.com \
    --cc=scott@netsplit.com \
    /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

all inboxes | Powered by JetHome®