Heya,
It seems I'm experiencing some data corruption on nfs when -w or -r
aren't powers of 2.

I have a local file with these settings:
% md5 sunclock.diff
MD5 (sunclock.diff) = 9f002849da08cd6ab76032a8cf2726e1

now, if I export the filesystem (nfsd -tu -n 4) it's on I get data
corruption when I try to use a readsize or writesize that's not a power
of 2:

% mount_nfs -3 -T spectre:/home /mnt
% md5 /mnt/inphobia/sunclock.diff
MD5 (/mnt/inphobia/sunclock.diff) = 9f002849da08cd6ab76032a8cf2726e1
% umount /mnt
 
% mount_nfs -3 -T -r 32768 -w 32768 spectre:/home /mnt
% md5 /mnt/inphobia/sunclock.diff
MD5 (/mnt/inphobia/sunclock.diff) = 9f002849da08cd6ab76032a8cf2726e1
% umount /mnt
 
% mount_nfs -3 -T -r 32000 -w 32000 spectre:/home /mnt
% md5 /mnt/inphobia/sunclock.diff
MD5 (/mnt/inphobia/sunclock.diff) = d9bfc86665d9619e19c2a317f12b0c09
% umount /mnt        
 
% mount_nfs -3 -U -r 32000 -w 32000 spectre:/home /mnt
% md5 /mnt/inphobia/sunclock.diff
MD5 (/mnt/inphobia/sunclock.diff) = d9bfc86665d9619e19c2a317f12b0c09
% umount /mnt

The nfs client is i386 -current, the server is i386 4.0 stable.

Yes, the manual page says I should use a power of 2 greater than
or equal to 1024, but perhaps it could warn that if I don't my data
will get corrupted? Or perhaps have mount_nfs refuse mounts with an
incorrect read/writesize - sane defaults?

And the background of this:
I was lazy and just wanted to do a mount -r 32k -w 32k, but since that
is refused I was lazy again and just mounted with -r 32000 -w 32000,
which makes the actual mount show up as:
spectre:/home on /mnt type nfs (v3, udp, wsize=31744, rsize=31744,
rdirsize=31744, timeo=100)

Ohw, and it's not just md5 that fails. While the contents of text files
look sane, I actually stumbled upon this while trying to recode a flac
file to an mp3. Mounting with wrong readsizes caused flac to spew out
errors, after remounting with correct sizes it worked fine.

// nick

Reply via email to