Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Aug 1998 15:05:46 -0700
From:      Mika Nystroem <mika@cs.caltech.edu>
To:        Peter Hawkins <thepish@FreeBSD.ORG>
Cc:        mika@varese.cs.caltech.edu, freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/7596: serious data integrity problem when reading WHILE writing NFSv3 client-end 
Message-ID:  <199808132205.PAA21525@varese.cs.caltech.edu>
In-Reply-To: Your message of "Thu, 13 Aug 1998 23:59:22 %2B1000." <Pine.BSF.3.96.980813235223.473A-100000@dana.clari.net.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Hawkins writes:
>Mika,
>
>I've been unable to reproduce it yet but am trying to (my NFS server seems
>to be rooted) So for now I'd like it if you could help me experiment
>
>>Hmm, this is very curious.  You don't think the page boundary 
>>business could have to do with stdio buffering (or some other
>>mechanism for delaying writes at the page boundaries)?
>
>possible - could you try having it use fprintf(stdout...
>and redirect to the file from the shell please? If you can get the error
>doing that then try fprintf(stderr and do a 2> x to see. (stderr is
>unbufferred).

I did fwrite to stdout.  That has the same effect, except things are now
block-aligned (I'm not fflushing stdout).

And, predictably, fwrite to stderr gives the same results, except now
the nulls are scattered every which where.

>
>>   fp=fopen("x","wb");
>
>just to be certain - remove the "b" (both read and write) as it *should* be
>ignored.

Not using fopen anymore since I am using stdout and stderr.
When I use fopen, removing the "b" makes no difference, either.
Btw, reading with just /bin/cp also screws things up.
Reading just the first few words of the file (rather than up to EOF)
doesn't seem to mess things up.

>
>>The random stuff is actually unnecessary, but it shows that the
>>problem is not page-boundary-related.  The sine business is just
>>a delay loop, and is necessary.  If the code looks a bit weird,
>
>So you don't see this behaviour without a random pause? Starting to sound
>almost like a bug in the wd driver!

Well I figure the pause makes data stick around in the NFS v3 write 
buffer (or whatever the proper name is) for longer..  No data corruption
occurs if the writer is writing data at full blast.  Now, if I could
make a circuit simulator do that... :)

Is wd the ISA IDE driver?  There isn't any IDE as far as the eye can
see here.. Intel fxp0 fast ethernet, ethernet switch, fileserver with
striped CCD fast/wide SCSI disks.  (Or on the solaris NFS server, 
thicknet, SCSI-1.)

   Mika

>Peter
>
>Hilink Internet            Peter Hawkins
>381 Swan St Richmond,      
>Vic, Australia             Ph: +61-3-9421 2006 Fax: +61-3-9421 2007
>http://www.hilink.com.au   Peter@hilink.com.au
>
>FreeBSD Project:           thepish@FreeBSD.org
>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808132205.PAA21525>