public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Alexander Shishkin <virtuoso@slind.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Feng Tang <feng.tang@intel.com>, Michael Tokarev <mjt@tls.msk.ru>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	John Stultz <johnstul@us.ibm.com>,
	Chris Friesen <chris.friesen@genband.com>,
	Kay Sievers <kay.sievers@vrfy.org>,
	"Kirill A. Shutemov" <kirill@shutemov.name>,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Davide Libenzi <davidel@xmailserver.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-api@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: timerfd-add-tfd_notify_clock_set-to-watch-for-clock-changes.patch added to -mm tree
Date: Fri, 11 Mar 2011 14:50:23 +0100	[thread overview]
Message-ID: <20110311135023.GA23552@redhat.com> (raw)

> @@ -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.


             reply	other threads:[~2011-03-11 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 13:50 Oleg Nesterov [this message]
2011-03-11 15:08 ` timerfd-add-tfd_notify_clock_set-to-watch-for-clock-changes.patch added to -mm tree Alexander Shishkin
2011-03-11 16:23 ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110311135023.GA23552@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=chris.friesen@genband.com \
    --cc=davidel@xmailserver.org \
    --cc=dedekind1@gmail.com \
    --cc=feng.tang@intel.com \
    --cc=gregkh@suse.de \
    --cc=johnstul@us.ibm.com \
    --cc=kay.sievers@vrfy.org \
    --cc=kirill@shutemov.name \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    --cc=mtk.manpages@gmail.com \
    --cc=mtosatti@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=virtuoso@slind.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox