From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Barry Song <21cnbao@gmail.com>
Cc: akpm@linux-foundation.org, davem@davemloft.net,
patrick.ohly@intel.com, uclinux-dist-devel@blackfin.uclinux.org,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] Fix half-Y2K38 problem in timecompare_update while calculating offset
Date: Wed, 30 Sep 2009 13:35:34 +0800 [thread overview]
Message-ID: <2375c9f90909292235p7c21776aodd855a4ffa82afa8@mail.gmail.com> (raw)
In-Reply-To: <1254133004-24877-1-git-send-email-21cnbao@gmail.com>
On Mon, Sep 28, 2009 at 6:16 PM, Barry Song <21cnbao@gmail.com> wrote:
> ktime will overflow from 03:14:07 UTC on Tuesday, 19 January 2038,
> ktime_add() in timecompare_update() will overflow a half earlier.
> As a result, wrong offset will be gotten, then cause some strange
> problems.
> ---
> kernel/time/timecompare.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/time/timecompare.c b/kernel/time/timecompare.c
> index 71e7f1a..d2d893e 100644
> --- a/kernel/time/timecompare.c
> +++ b/kernel/time/timecompare.c
> @@ -89,7 +89,7 @@ int timecompare_offset(struct timecompare *sync,
> * source time
> */
> sample.offset =
> - ktime_to_ns(ktime_add(end, start)) / 2 -
> + (ktime_to_ns(end) + ktime_to_ns(start)) / 2 -
> ts;
>
> /* simple insertion sort based on duration */
Just please add your Signed-off-by.
I think you catch the right thing, so
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Add Cc: Thomas Gleixner <tglx@linutronix.de>.
prev parent reply other threads:[~2009-09-30 5:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-28 10:16 Barry Song
2009-09-30 2:44 ` Mike Frysinger
2010-01-05 19:28 ` Mike Frysinger
2010-01-06 3:18 ` Barry Song
2009-09-30 5:35 ` Américo Wang [this message]
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=2375c9f90909292235p7c21776aodd855a4ffa82afa8@mail.gmail.com \
--to=xiyou.wangcong@gmail.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=patrick.ohly@intel.com \
--cc=tglx@linutronix.de \
--cc=uclinux-dist-devel@blackfin.uclinux.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
all inboxes | Powered by JetHome®