[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090701160610.GA32012@redhat.com>
Date: Wed, 1 Jul 2009 18:06:10 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Neil Horman <nhorman@...driver.com>
Cc: linux-kernel@...r.kernel.org, alan@...rguk.ukuu.org.uk,
andi@...stfloor.org, akpm@...ux-foundation.org,
earl_chew@...lent.com
Subject: Re: [PATCH 3/3] exec: Allow do_coredump to wait for user space
pipe readers to complete (v5)
Neil, the changelog is not right,
On 07/01, Neil Horman wrote:
>
> We basically add ourselves as an additional
> reader (to prevent cleanup of the pipe), write the dump in ->core_dump(),
This is not what we do. We do not and must not inc readers before
->core_dump(). We only do this in wait_for_dump_helpers().
> note that we add ourselves as a reader before writing the
> file. this closes the race in the window between the time we write the dump and
> the time we start checking for the user space process to be done with the pipe.
again, this doesn't match the patch.
> +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) {
> + wake_up_interruptible_sync(&pipe->wait);
> + kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
> + pipe_wait(pipe);
> + }
> +
> + /*
> + * This reclaims the additional readers count we took in
> + * do_coredump
> + */
now the comment is wrong.
Can't understand why do you change readers/writers unconditianally,
we shouldn't have the false wakeups since ->writers == 0, but OK.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists