public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: Josip Loncaric <josip@lanl.gov>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net/sunrpc: fix time conversion error
Date: Tue, 02 Aug 2005 02:03:59 +0200	[thread overview]
Message-ID: <42EEB86F.1090808@trash.net> (raw)
In-Reply-To: <20050801225643.GA4285@us.ibm.com>

Nishanth Aravamudan wrote:
> On 01.08.2005 [15:11:48 -0600], Josip Loncaric wrote:
> 
>>Line 589 of linux-2.6.11.10/net/sunrpc/svcsock.c is obviously wrong:
>>
>>                skb->stamp.tv_usec = xtime.tv_nsec * 1000;
>>
>>To convert nsec to usec, one should divide instead of multiplying:
>>
>>                skb->stamp.tv_usec = xtime.tv_nsec / 1000;
>>
>>The same bug could be present in the latest kernels, although I haven't 
>>checked.  This bug makes svc_udp_recvfrom() timestamps incorrect.
> 
> 
> Agreed, the conversion is wrong. I think the code is buggy period, as it
> accesses xtime without grabbing the xtime_lock first. Following patch
> should fix both issues.
> 
> Description: This function incorrectly multiplies a nanosecond value by
> 1000, instead of dividing by 1000, to obtain a corresponding microsecond
> value. Fix the math. Also, the function incorrectly accesses xtime
> without using the xtime_lock. Fixed as well. Patch is compile-tested.

Depending on in which release you want this patch included, you might
want to redo it against Dave's net-2.6.14 tree. It includes a patch that
changes skb->stamp to an offset against a base timestamp.

Regards
Patrick

PS: I'll submit the patch to break compilation for unconverted users
ASAP.

  reply	other threads:[~2005-08-02  0:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-01 21:11 Time conversion error in linux-2.6.11.10/net/sunrpoc/svcsock.c Josip Loncaric
2005-08-01 22:56 ` [PATCH] net/sunrpc: fix time conversion error Nishanth Aravamudan
2005-08-02  0:03   ` Patrick McHardy [this message]
2005-08-02  0:11     ` Nishanth Aravamudan

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=42EEB86F.1090808@trash.net \
    --to=kaber@trash.net \
    --cc=josip@lanl.gov \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nacc@us.ibm.com \
    --cc=netdev@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