All of lore.kernel.org
 help / color / mirror / Atom feed
* Bad  nsec conversion  in svc_udp_recvfrom()
@ 2005-10-26  8:36 ` Steve Dickson
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2005-10-26  8:36 UTC (permalink / raw)
  To: nfs; +Cc: linux-kernel

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.




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Bad  nsec conversion  in svc_udp_recvfrom()
@ 2005-10-26  8:36 ` Steve Dickson
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2005-10-26  8:36 UTC (permalink / raw)
  To: nfs; +Cc: linux-kernel

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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bad  nsec conversion  in svc_udp_recvfrom()
  2005-10-26  8:36 ` Steve Dickson
@ 2005-10-26  8:50   ` Andrew Morton
  -1 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2005-10-26  8:50 UTC (permalink / raw)
  To: Steve Dickson; +Cc: nfs, linux-kernel, Patrick McHardy

Steve Dickson <SteveD@redhat.com> wrote:
>
> 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...
> 

Yes, that's screwed up - well spotted.

Patrick, please be more careful about these things.

I'll fix it up.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bad  nsec conversion  in svc_udp_recvfrom()
@ 2005-10-26  8:50   ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2005-10-26  8:50 UTC (permalink / raw)
  To: Steve Dickson; +Cc: nfs, linux-kernel, Patrick McHardy

Steve Dickson <SteveD@redhat.com> wrote:
>
> 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...
> 

Yes, that's screwed up - well spotted.

Patrick, please be more careful about these things.

I'll fix it up.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-26  8:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-26  8:36 Bad nsec conversion in svc_udp_recvfrom() Steve Dickson
2005-10-26  8:36 ` Steve Dickson
2005-10-26  8:50 ` Andrew Morton
2005-10-26  8:50   ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.