Re: [PATCH 1/5] hrtimer_nanosleep: use -EINTR, not -ERESTARTNOHAND

From: Thomas Gleixner
Date: Fri Feb 01 2008 - 08:51:52 EST


On Fri, 1 Feb 2008, Oleg Nesterov wrote:

> hrtimer_nanosleep:
>
> /* Absolute timers do not update the rmtp value and restart: */
> return -ERESTARTNOHAND;
>
> This is not right, -ERESTARTNOHAND means we will do restart if there is no
> in fact pending signal, and worse, this restart will use the same unchanged
> "__user *rmtp" parameter.

-ERESTARTNOHAND is safe here. We want to restart the timer.

The rmtp problem is separate, but that's addressed by your follow up changes.

Thanks,
tglx

> Use -EINTR instead.
>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
>
> --- MM/kernel/hrtimer.c~HRT_RMTP~ 2008-01-27 17:07:39.000000000 +0300
> +++ MM/kernel/hrtimer.c~HRT_RMTP 2008-02-01 13:43:52.000000000 +0300
> @@ -1359,7 +1359,7 @@ long hrtimer_nanosleep(struct timespec *
>
> /* Absolute timers do not update the rmtp value and restart: */
> if (mode == HRTIMER_MODE_ABS)
> - return -ERESTARTNOHAND;
> + return -EINTR;
>
> if (rmtp) {
> rem = ktime_sub(t.timer.expires, t.timer.base->get_time());
>
--
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/