Re: [PATCH 1/5] Split wait_noreap_copyout()
From: Oleg Nesterov
Date: Wed May 20 2009 - 12:02:20 EST
On 05/20, Vitaly Mayatskikh wrote:
>
> At Mon, 11 May 2009 15:25:50 +0200, Vitaly Mayatskikh wrote:
> >
> Oleg has pointed me to broken behaviour here. Previously
> wait_noreap_copyout was doing unconditional put_user and was returning
> EFAULT when infop is NULL. Now it uses copy_wait_opts_to_user, which
> checks infop and return NULL in the same case. This change is visible
> from userspace in waitid() function.
To me, this behaviour change looks like the cleanup (if not fix) too.
But of course, this should be discussed and at least documented in the
changelog.
do_wait() && infop interaction is really strange before the patch.
When do_wait() is called without WNOWAIT, then infop == NULL is fine.
If WNOWAIT is set, we return -EFAULT. Except in WCONTINUED case
infop == NULL is fine again.
Can somebody explain what is the supposed behaviour?
Otherwise, in my opinion this series realy makes the code better,
and afaics it allows to simplify the code more.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/