From: Greg KH <[email protected]>

3.0-stable review patch.  If anyone has any objections, please let me know.

------------------


From: John Stultz <[email protected]>

This is a backport of fad0c66c4bb836d57a5f125ecd38bed653ca863a
which resolves a bug the previous commit.

Commit 6b43ae8a61 (ntp: Fix leap-second hrtimer livelock) broke the
leapsecond update of CLOCK_MONOTONIC. The missing leapsecond update to
wall_to_monotonic causes discontinuities in CLOCK_MONOTONIC.

Adjust wall_to_monotonic when NTP inserted a leapsecond.

Reported-by: Richard Cochran <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Tested-by: Richard Cochran <[email protected]>
Link: 
http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Prarit Bhargava <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 kernel/time/timekeeping.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -824,6 +824,7 @@ static cycle_t logarithmic_accumulation(
                xtime.tv_sec++;
                leap = second_overflow(xtime.tv_sec);
                xtime.tv_sec += leap;
+               wall_to_monotonic.tv_sec -= leap;
        }
 
        /* Accumulate raw time */
@@ -934,7 +935,7 @@ static void update_wall_time(void)
                xtime.tv_sec++;
                leap = second_overflow(xtime.tv_sec);
                xtime.tv_sec += leap;
-
+               wall_to_monotonic.tv_sec -= leap;
        }
 
        /* check to see if there is a new clocksource to use */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to