lkml.org 
[lkml]   [2009]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] exec: Allow do_coredump to wait for user space pipe readers to complete (v7)
On 07/02, Neil Horman wrote:
>
> +static void wait_for_dump_helpers(struct file *file)
> +{
> + struct pipe_inode_info *pipe;
> +
> + pipe = file->f_path.dentry->d_inode->i_pipe;
> +
> + pipe_lock(pipe);
> + pipe->readers++;
> + pipe->writers--;
> +
> + while ((pipe->readers > 1) && (!fatal_signal_pending(current))) {
> + wake_up_interruptible_sync(&pipe->wait);
> + kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
> + pipe_wait(pipe);
> + }

The kernel can hang on UP machine.

Suppose that rt task starts the coredump and then recieves a non-fatal
signal before core_pattern app closes stdin.

In that case this "while()" above becomes a busy-wait loop which never
stops.
Neil, please use signal_pending() as I said. Yes, this means wait_for_
will abort if we recieve a non-fatal signal. But as I said we have other
problems with signals here, when we fix them wait_for_dump_helpers()
will be fixed automatically.

Oleg.



\
 
 \ /
  Last update: 2009-07-03 12:21    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site