timerfd: Fix wakeup of processes when timer is cancelled on clock change
authorMax Asbock <masbock@linux.vnet.ibm.com>
Mon, 13 Jun 2011 17:18:32 +0000 (10:18 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 14 Jun 2011 09:46:14 +0000 (11:46 +0200)
commit1123d93963cbd2546449d4d9f0c568e323cb0ac6
treef8d9a07c85bab7e82c8e0b55c98dff9d8dff94db
parent2c53b436a30867eb6b47dd7bab23ba638d1fb0d2
timerfd: Fix wakeup of processes when timer is cancelled on clock change

Currently processes waiting with poll on cancelable timerfd timers are
not woken up when the timers are canceled. When the system time is set
the clock_was_set() function calls timerfd_clock_was_set() to cancel
and wake up processes waiting on potential cancelable timerfd
timers. However the wake up currently has no effect because in the
case of timerfd_read it is dependent on ctx->ticks not being
0. timerfd_poll also requires ctx->ticks being non zero. As a
consequence processes waiting on cancelable timers only get woken up
when the timers expire. This patch fixes this by incrementing
ctx->ticks before calling wake_up.

Signed-off-by: Max Asbock <masbock@linux.vnet.ibm.com>
Cc: kay.sievers@vrfy.org
Cc: virtuoso@slind.org
Cc: johnstul <johnstul@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/1307985512.4710.41.camel@w-amax.beaverton.ibm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/timerfd.c