Re: [PATCH 4/4] posix-timers: turn it_signal into it_valid flag
From: Eric Dumazet
Date: Fri Sep 02 2011 - 07:50:11 EST
Le vendredi 02 septembre 2011 Ã 12:06 +0200, Thomas Gleixner a Ãcrit :
> ------------------>
> Subject: posix-timers: Simplify deletion protection
> From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Date: Fri, 02 Sep 2011 11:59:14 +0200
>
> k_itimer->it_signal is soleley used to protect a timer lookup against
> a concurrent deletion. We can use k_itimer->list for the same purpose.
>
Well, this patch is wrong too, unless you base it after Andi patch 1/4
(move global timer id management to signal_struct)
The test is also present to make sure one process doesnt try to use a
timer_id of another process.
> @@ -643,7 +643,7 @@ static struct k_itimer *__lock_timer(tim
> timr = idr_find(&posix_timers_id, (int)timer_id);
> if (timr) {
> spin_lock_irqsave(&timr->it_lock, *flags);
> - if (timr->it_signal == current->signal) {
> + if (!list_empty(&timr->list)) {
> rcu_read_unlock();
> return timr;
> }
--
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/