Skip to content

Commit 7611766

Browse files
richardcochranbwhacks
authored andcommitted
ntp: Correct TAI offset during leap second
commit dd48d70 upstream. 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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
1 parent a57ccab commit 7611766

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
@@ -378,6 +378,7 @@ int second_overflow(unsigned long secs)
378378
if (secs % 86400 == 0) {
379379
leap = -1;
380380
time_state = TIME_OOP;
381+
time_tai++;
381382
printk(KERN_NOTICE
382383
"Clock: inserting leap second 23:59:60 UTC\n");
383384
}
@@ -392,7 +393,6 @@ int second_overflow(unsigned long secs)
392393
}
393394
break;
394395
case TIME_OOP:
395-
time_tai++;
396396
time_state = TIME_WAIT;
397397
break;
398398

0 commit comments

Comments
 (0)