Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90675a27 authored by Daniel Walker's avatar Daniel Walker Committed by Linus Torvalds
Browse files

[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: default avatarDaniel Walker <dwalker@mvista.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Acked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7a434814
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -862,6 +862,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 */