Linux NFS development
 help / color / mirror / Atom feed
* Re: 2.5: NFS troubles
       [not found]     ` <1049675270.753.166.camel@localhost>
@ 2003-04-07 13:23       ` Trond Myklebust
  2003-04-07 15:17         ` Robert Love
  0 siblings, 1 reply; 2+ messages in thread
From: Trond Myklebust @ 2003-04-07 13:23 UTC (permalink / raw)
  To: Robert Love, Siim Vahtre; +Cc: linux-kernel, NFS maillist


OK. I've managed to squash the NFS read corruption problems that I had
on my 2.5.x client setup with the following patch.
Since the two of you reported what appears to be the same problem,
would you mind trying it out?

The fix basically tightens up consistency checks in the process of
reading the skb (which is done in the sk->data_ready() callback).

Cheers,
  Trond

diff -u --recursive --new-file linux-2.5.66-10-nr_dirty/net/sunrpc/xprt.c linux-2.5.66-11-fix_read/net/sunrpc/xprt.c
--- linux-2.5.66-10-nr_dirty/net/sunrpc/xprt.c	2003-03-27 18:34:08.000000000 +0100
+++ linux-2.5.66-11-fix_read/net/sunrpc/xprt.c	2003-04-07 15:15:29.000000000 +0200
@@ -625,7 +625,8 @@
 {
 	if (len > desc->count)
 		len = desc->count;
-	skb_copy_bits(desc->skb, desc->offset, to, len);
+	if (skb_copy_bits(desc->skb, desc->offset, to, len))
+		return 0;
 	desc->count -= len;
 	desc->offset += len;
 	return len;
@@ -669,11 +670,15 @@
 		csum2 = skb_checksum(skb, desc.offset, skb->len - desc.offset, 0);
 		desc.csum = csum_block_add(desc.csum, csum2, desc.offset);
 	}
+	if (desc.count)
+		return -1;
 	if ((unsigned short)csum_fold(desc.csum))
 		return -1;
 	return 0;
 no_checksum:
 	xdr_partial_copy_from_skb(xdr, 0, &desc, skb_read_bits);
+	if (desc.count)
+		return -1;
 	return 0;
 }
 
@@ -750,7 +755,8 @@
 {
 	if (len > desc->count)
 		len = desc->count;
-	skb_copy_bits(desc->skb, desc->offset, p, len);
+	if (skb_copy_bits(desc->skb, desc->offset, p, len))
+		return 0;
 	desc->offset += len;
 	desc->count -= len;
 	return len;

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

* Re: 2.5: NFS troubles
  2003-04-07 13:23       ` 2.5: NFS troubles Trond Myklebust
@ 2003-04-07 15:17         ` Robert Love
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Love @ 2003-04-07 15:17 UTC (permalink / raw)
  To: trond.myklebust; +Cc: Siim Vahtre, linux-kernel, NFS maillist

On Mon, 2003-04-07 at 09:23, Trond Myklebust wrote:

> OK. I've managed to squash the NFS read corruption problems that I had
> on my 2.5.x client setup with the following patch.
> Since the two of you reported what appears to be the same problem,
> would you mind trying it out?

This fixes it for me.  No errors, no corruption.

I did a verify of the md5sums of all of the Red Hat 9 RPM packages over
NFS.  I had random failures (in different packages each time) before.

I just did it twice to be sure -- it works.

Thank you, Trond.

	Robert Love

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

end of thread, other threads:[~2003-04-07 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1049630768.592.24.camel@teapot.felipe-alfaro.com>
     [not found] ` <shsbrzjn5of.fsf@charged.uio.no>
     [not found]   ` <20030406171855.6bd3552d.akpm@digeo.com>
     [not found]     ` <1049675270.753.166.camel@localhost>
2003-04-07 13:23       ` 2.5: NFS troubles Trond Myklebust
2003-04-07 15:17         ` Robert Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox