mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: nfs@lists.sourceforge.net
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Bad  nsec conversion  in svc_udp_recvfrom()
Date: Wed, 26 Oct 2005 04:36:12 -0400	[thread overview]
Message-ID: <435F3FFC.6020303@RedHat.com> (raw)

In patch-2.6.14-rc5 there is the following:
@@ -584,13 +583,16 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
         /* possibly an icmp error */
         dprintk("svc: recvfrom returned error %d\n", -err);
     }
-   if (skb->stamp.tv_sec == 0) {
-       skb->stamp.tv_sec = xtime.tv_sec;
-       skb->stamp.tv_usec = xtime.tv_nsec / NSEC_PER_USEC;
+   if (skb->tstamp.off_sec == 0) {
+       struct timeval tv;
+
+       tv.tv_sec = xtime.tv_sec;
+       tv.tv_usec = xtime.tv_nsec * 1000;
+       skb_set_timestamp(skb, &tv);
         /* Don't enable netstamp, sunrpc doesn't
            need that much accuracy */
     }
-   svsk->sk_sk->sk_stamp = skb->stamp;
+   skb_get_timestamp(skb, &svsk->sk_sk->sk_stamp);
     set_bit(SK_DATA, &svsk->sk_flags); /* there may be more data... */

     /*
Shouldn't tv.tv_usec = xtime.tv_nsec * 1000
be tv.tv_usec = xtime.tv_nsec / 1000 or possible
tv.tv_usec = xtime.tv_nsec / NSEC_PER_USEC ?

The was fixed by a previous patch
(see http://lkml.org/lkml/2005/8/1/251)
but now it seems to be broken again...

steved.



             reply	other threads:[~2005-10-26  8:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-26  8:36 Steve Dickson [this message]
2005-10-26  8:50 ` Andrew Morton

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=435F3FFC.6020303@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    /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®