linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: timerfd-add-tfd_notify_clock_set-to-watch-for-clock-changes.patch added to -mm tree
@ 2011-03-11 13:50 Oleg Nesterov
       [not found] ` <20110311135023.GA23552-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Nesterov @ 2011-03-11 13:50 UTC (permalink / raw)
  To: Alexander Shishkin
  Cc: Thomas Gleixner, Alexander Viro, Greg Kroah-Hartman, Feng Tang,
	Michael Tokarev, Marcelo Tosatti, John Stultz, Chris Friesen,
	Kay Sievers, Kirill A. Shutemov, Artem Bityutskiy, Davide Libenzi,
	Michael Kerrisk, linux-api-u79uwXL29TY76Z2rM5mHXA, Andrew Morton,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

> @@ -218,10 +266,12 @@ SYSCALL_DEFINE4(timerfd_settime, int, uf
>  	 * it to the new values.
>  	 */
>  	for (;;) {
> +		spin_lock(&notifiers_lock);
>  		spin_lock_irq(&ctx->wqh.lock);
> -		if (hrtimer_try_to_cancel(&ctx->tmr) >= 0)
> +		if (!list_empty(&notifiers_list) || hrtimer_try_to_cancel(&ctx->tmr) >= 0)
>  			break;

Confused. Why do we check the global notifiers_list?

IOW. Suppose that this list is not empty and timerfd_settime() is called
without TFD_NOTIFY_CLOCK_SET. Now we are going to reprogramm the timer
without stopping it?

And. What if timerfd_settime(TFD_NOTIFY_CLOCK_SET, utmr => NULL) is called
twice? timerfd_setup() blindly does list_add(), and we corrupt the list, no?

Oleg.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-11 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-11 13:50 timerfd-add-tfd_notify_clock_set-to-watch-for-clock-changes.patch added to -mm tree Oleg Nesterov
     [not found] ` <20110311135023.GA23552-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-03-11 15:08   ` Alexander Shishkin
2011-03-11 16:23   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).