Re: [PATCH] posix-timer: fix deletion race

From: Thomas Gleixner
Date: Tue Jul 17 2007 - 13:02:38 EST


On Tue, 2007-07-17 at 17:07 +0400, Oleg Nesterov wrote:
> I think we can make a simpler patch,
>
> --- posix-timers.c~ 2007-06-29 14:45:04.000000000 +0400
> +++ posix-timers.c 2007-07-17 16:59:45.000000000 +0400
> @@ -449,6 +449,9 @@ static void release_posix_timer(struct k
> idr_remove(&posix_timers_id, tmr->it_id);
> spin_unlock_irqrestore(&idr_lock, flags);
> }
> +
> + spin_unlock_wait(tmr->it_lock);
> +
> sigqueue_free(tmr->sigq);
> if (unlikely(tmr->it_process) &&
> tmr->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
>
>
> What do you think? Instead of complicating the lock_timer(), release_posix_timer()
> just makes sure that nobody can "use" tmr.

Hmm, I prefer to fix that at the place where the race actually happens.

tglx


-
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/