aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/timer.c
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2007-03-06 04:42:11 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-06 12:30:25 -0500
commit90675a27fa3eb0e97f1d040b183cceb44316e669 (patch)
treecf97bd53de877c12798368a4e06bba21285c0763 /kernel/timer.c
parent7a434814c7a6500b08bf4419ba8712b152d08d08 (diff)
[PATCH] fix vsyscall settimeofday
I've only seen this on x86_64. The vsyscall state only gets updated when a timer interrupts comes in. So if the time is set long before the next timer, there will be a period when a gettimeofday() won't reflect the correct time. I added an explicit update_vsyscall() during the settimeofday(), that way the vsyscall state doesn't get stale. Signed-off-by: Daniel Walker <dwalker@mvista.com> Cc: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ingo Molnar <mingo@elte.hu> Acked-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/timer.c')
-rw-r--r--kernel/timer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index ee0a2da4aab3..797cccb86431 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -862,6 +862,8 @@ int do_settimeofday(struct timespec *tv)
862 clock->error = 0; 862 clock->error = 0;
863 ntp_clear(); 863 ntp_clear();
864 864
865 update_vsyscall(&xtime, clock);
866
865 write_sequnlock_irqrestore(&xtime_lock, flags); 867 write_sequnlock_irqrestore(&xtime_lock, flags);
866 868
867 /* signal hrtimers about time change */ 869 /* signal hrtimers about time change */