From: john stultz <johnstul@us.ibm.com>
To: Christoph Lameter <clameter@engr.sgi.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] Use proper casting with signed timespec.tv_nsec values
Date: Tue, 06 Sep 2005 12:54:37 -0700 [thread overview]
Message-ID: <1126036477.14172.4.camel@cog.beaverton.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0509061032010.16745@schroedinger.engr.sgi.com>
On Tue, 2005-09-06 at 10:33 -0700, Christoph Lameter wrote:
> On Thu, 1 Sep 2005, john stultz wrote:
>
> > I recently ran into a bug with an older kernel where xtime's tv_nsec
> > field had accumulated more then 2 seconds worth of time. The timespec's
> > tv_nsec is a signed long, however gettimeofday() treats it as an
> > unsigned long. Thus when the failure occured, very strange and difficult
> > to debug time problems occurred.
>
> How can that happen? I think the source of the problem needs to be fixed.
> The fix is only going decrease the likelyhood of the problem occurring.
Really it shouldn't, I'm just adding the extra casting to be more
explicit to if at some point in the future a bug does creep up, it will
be easier to understand. The code is assuming we're unsigned, so why not
make that clear to the compiler?
Granted, its not really all that critical and it is a bit paranoid. I
just figured I'd float the patch to see if folks thought it would be a
good idea.
thanks
-john
prev parent reply other threads:[~2005-09-06 19:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-01 21:03 john stultz
2005-09-01 21:37 ` Eric Dumazet
2005-09-01 22:25 ` john stultz
2005-09-02 1:14 ` George Anzinger
2005-09-06 17:33 ` Christoph Lameter
2005-09-06 19:54 ` john stultz [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=1126036477.14172.4.camel@cog.beaverton.ibm.com \
--to=johnstul@us.ibm.com \
--cc=clameter@engr.sgi.com \
--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
all inboxes | Powered by JetHome®