Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754058AbbBRRi5 (ORCPT ); Wed, 18 Feb 2015 12:38:57 -0500 Received: from cantor2.suse.de ([195.135.220.15]:53792 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbbBRRiz (ORCPT ); Wed, 18 Feb 2015 12:38:55 -0500 Date: Wed, 18 Feb 2015 18:38:52 +0100 From: Jiri Bohac To: Jiri Bohac Cc: John Stultz , Roman Zippel , Prarit Bhargava , lkml , Thomas Gleixner , Miroslav Lichvar , Peter Zijlstra Subject: Re: [PATCH] time, ntp: Do not update time_state in middle of leap second [v3] Message-ID: <20150218173852.GB31353@midget.suse.cz> References: <1423749499-18520-1-git-send-email-prarit@redhat.com> <20150218171404.GA31353@midget.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150218171404.GA31353@midget.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1458 Lines: 39 On Wed, Feb 18, 2015 at 06:14:04PM +0100, Jiri Bohac wrote: > I think the only real problem occurs when the adjtimex is called in the > the TIME_OOP state ... or the TIME_WAIT state ... > with STA_PLL cleared _and_ STA_INS set. > In this case the state machine is reset to TIME_OK but goes back > to TIME_INS on the next second_overflow, potentially causing > another false leap second to be inserted on the following > midnight. > > The state machine is meant to only go back to TIME_INS once STA_INS is > cleared and then set again - this is what the TIME_WAIT state is > for. > > In fact, I don't see a reason why the STA_PLL -> !STA_PLL transition should > ever set the time_state to TIME_OK. > - When the STA_INS/STA_DEL flag is removed from the status, the state > machine will end up in TIME_OK from any state. > - When STA_INS/STA_DEL is set in > the status, the state mchine will transition from TIME_OK to > TIME_INS/TIME_DEL anyway. > > I think the "time_status = TIME_OK" should be just dropped. > > It has been added by eea83d896e318bda54be2d2770d2c5d6668d11db > (ntp: NTP4 user space bits update) and it's not clear why. > Roman? -- Jiri Bohac SUSE Labs, SUSE CZ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/