public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Schiffner <bernhard@schiffner-limbach.de>
To: linux-kernel@vger.kernel.org
Subject: ntp.c : possible inconsistency?
Date: Wed, 10 Jan 2007 14:23:36 +0100	[thread overview]
Message-ID: <200701101423.36740.bernhard@schiffner-limbach.de> (raw)

Hi,

trying to find reasons for some crazy ntpd-behavior I read
http://lkml.org/lkml/2006/10/27/67

This thread doesn't result in a pulished patch, so I (hopefully) did what was 
said there. The patch doesn't break my system, but it doesn't change ntpd's 
crazyness too.
Nevertheless it should be discussed again in the sense of preventing an 
inconsistency.

Bernhard


PS:
Can someone point me to the reason for doing txc->constant + 4, please?

References:
lkml-thread (start)
http://lkml.org/lkml/2006/10/26/47

ntpd-crazyness (comparing 2.6.15 with 2.6.19)
http://ml.enneenne.com/pipermail/linuxpps/2006-December/000482.html

Patch:
index 3afeaa3..36d7ecc 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -263,7 +263,7 @@ int do_adjtimex(struct timex *txc)
                    result = -EINVAL;
                    goto leave;
                }
-               time_constant = min(txc->constant + 4, (long)MAXTC);
+               time_constant = min(txc->constant + 4, (long)MAXTC + 4);
            }

            if (txc->modes & ADJ_OFFSET) {      /* values checked earlier */
@@ -329,7 +329,7 @@ leave:      if ((time_status & (STA_UNSYNC|
STA_CLOCKERR)) != 0)
        txc->maxerror      = time_maxerror;
        txc->esterror      = time_esterror;
        txc->status        = time_status;
-       txc->constant      = time_constant;
+       txc->constant      = time_constant - 4;
        txc->precision     = 1;
        txc->tolerance     = MAXFREQ;
        txc->tick          = tick_usec;

             reply	other threads:[~2007-01-10 13:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-10 13:23 Bernhard Schiffner [this message]
2007-01-10 14:30 ` ntp.c : possible inconsistency? Roman Zippel
2007-01-10 15:29   ` Bernhard Schiffner
2007-01-15 12:43     ` Roman Zippel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200701101423.36740.bernhard@schiffner-limbach.de \
    --to=bernhard@schiffner-limbach.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox