From nobody@FreeBSD.org  Tue Oct 16 12:02:58 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C880A16A46E
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 Oct 2007 12:02:58 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id AFE1A13C4B3
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 Oct 2007 12:02:58 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l9GC2msP099672
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 Oct 2007 12:02:48 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l9GC2mI6099667;
	Tue, 16 Oct 2007 12:02:48 GMT
	(envelope-from nobody)
Message-Id: <200710161202.l9GC2mI6099667@www.freebsd.org>
Date: Tue, 16 Oct 2007 12:02:48 GMT
From: P <pb@ludd.luth.spamsuck.se>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Stock i386/v6.0 nfs + cp -pRP cause corrupted files on destination volume.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         117241
>Category:       kern
>Synopsis:       [nfs] Stock i386/v6.0 nfs + cp -pRP cause corrupted files on destination volume.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 16 12:10:02 UTC 2007
>Closed-Date:    Mon Mar 03 07:26:00 UTC 2008
>Last-Modified:  Mon Mar 03 07:26:00 UTC 2008
>Originator:     P
>Release:        6.0-RELEASE #0
>Organization:
>Environment:
FreeBSD f6.my.domain 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov  3 09:36:13 UTC 2005     root@x64.samsco.home:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Mounting an nfs volume from a '6.2-RELEASE #0' machine with default
settings. Cause some files (50%?) to miss the last block of the file.
At least when copying gigabytes of data. Seems the destination file
length is = int(source_filesize/512)*512. In the other direction
(6.2 -> 6.0) there's no problem asfaik.

I have not investigated this problem 100%. But I think it's serious
enough that others should know.

Maybe some test script should be written to test for this condition
before releasing new versions?
>How-To-Repeat:
Probably setup machine1 with v6.0, and machine2 with v6.2. Then copy
many files via default nfs from v6.0 disc to v6.2 nfs volume.
pb@v60 ~ #cp -p img_8030.jpg /nfs62/
pb@v60 ~ #dir img_8030.jpg /nfs62/
-rw-r--r--  1 pb  wheel  3121562 Sep 24  2007 img_8030.jpg

/nfs62/:
-rw-r--r--  1 pb  wheel  3121152 Sep 24  2007 img_8030.jpg

3121562 / 512 = 6096.80078125
3121152 / 512 = 6096

3121562 % 512 = 410
3121152 % 512 = 0

>Fix:
Use tar/pax/cpio etc.. + tcp pipes.
Don't copy via nfs.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: kris 
State-Changed-When: Tue Dec 25 14:01:09 UTC 2007 
State-Changed-Why:  
Can you repeat this with a 6.2/6.3 client and server?  If not, it is 
most likely a bug in the 6.0 NFS client that was already fixed.  If 
you can repeat it on modern versions of FreeBSD, please provide a test 
script.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117241 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Mon Mar 3 07:25:41 UTC 2008 
State-Changed-Why:  
Feedback timeout (> 2 months). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117241 
>Unformatted:
