public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix vsyscall settimeofday
@ 2007-03-05 16:56 Daniel Walker
  2007-03-05 18:57 ` john stultz
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Walker @ 2007-03-05 16:56 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, johnstul

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.

Any thought John?

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

---
 kernel/timer.c |    2 ++
 1 file changed, 2 insertions(+)

Index: linux-2.6.20/kernel/timer.c
===================================================================
--- linux-2.6.20.orig/kernel/timer.c
+++ linux-2.6.20/kernel/timer.c
@@ -861,6 +861,8 @@ int do_settimeofday(struct timespec *tv)
 	clock->error = 0;
 	ntp_clear();
 
+	update_vsyscall(&xtime, clock);
+
 	write_sequnlock_irqrestore(&xtime_lock, flags);
 
 	/* signal hrtimers about time change */
-- 

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

end of thread, other threads:[~2007-03-05 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-05 16:56 [PATCH] fix vsyscall settimeofday Daniel Walker
2007-03-05 18:57 ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox