Skip to content

Commit dd48d70

Browse files
richardcochranjohnstultz-work
authored andcommitted
ntp: Correct TAI offset during leap second
When repeating a UTC time value during a leap second (when the UTC time should be 23:59:60), the TAI timescale should not stop. The kernel NTP code increments the TAI offset one second too late. This patch fixes the issue by incrementing the offset during the leap second itself. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
1 parent bdebaf8 commit dd48d70

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/time/ntp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ int second_overflow(unsigned long secs)
412412
if (secs % 86400 == 0) {
413413
leap = -1;
414414
time_state = TIME_OOP;
415+
time_tai++;
415416
printk(KERN_NOTICE
416417
"Clock: inserting leap second 23:59:60 UTC\n");
417418
}
@@ -426,7 +427,6 @@ int second_overflow(unsigned long secs)
426427
}
427428
break;
428429
case TIME_OOP:
429-
time_tai++;
430430
time_state = TIME_WAIT;
431431
break;
432432

0 commit comments

Comments
 (0)