Subject: kern/36548: Trailing NULs written to files over NFS
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <scw@netbsd.org>
List: netbsd-bugs
Date: 06/24/2007 15:50:00
>Number:         36548
>Category:       kern
>Synopsis:       Trailing NULs written to files over NFS
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 24 15:50:00 +0000 2007
>Originator:     Steve Woodford
>Release:        NetBSD 4.99.20
>Organization:
	
>Environment:
	
	
System: NetBSD slug.mctavish.co.uk 4.99.20 NetBSD 4.99.20 (NSLU2) #9: Sun Jun 24 15:48:32 BST 2007 steve@horace:/export/netbsd/sys/arch/evbarm/compile/NSLU2 evbarm
Architecture: armeb
Machine: evbarm
>Description:
Using -current from a couple of days ago on an NFS client (root on NFS too),
some trailing NUL bytes are showing up on some newly-written files.

ktrace(1) on the client shows correct data being written over a number of
calls to write(2). However, tcpdump(8) on the server shows the trailing
NUL bytes.

Interestingly, it's the data from the final call to write(2) which is being
replaced by the NUL bytes. Immediately after the write(2), the process
invokes exit(2). The file size is correct.

I can provide kdump(1) output if necessary.
>How-To-Repeat:
Try to build pkgsrc/pkgtools/digest over NFS. The work/.*_makevars.mk
will be corrupted as described.
>Fix:
Unknown.

>Unformatted:
 Under certain circumstances, trailing NULs are written to files over NFS