From nobody@FreeBSD.org  Thu Jun  3 19:58:53 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9BA6316A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  3 Jun 2004 19:58:53 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7BF8B43D31
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  3 Jun 2004 19:58:53 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i542wrkM066152
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 3 Jun 2004 19:58:53 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i542wrjn066151;
	Thu, 3 Jun 2004 19:58:53 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200406040258.i542wrjn066151@www.freebsd.org>
Date: Thu, 3 Jun 2004 19:58:53 -0700 (PDT)
From: Val P <secureplay@sbcglobal.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: fat32 corruption when using samba
X-Send-Pr-Version: www-2.3

>Number:         67555
>Category:       kern
>Synopsis:       fat32 corruption when using samba
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 03 20:00:45 PDT 2004
>Closed-Date:    Sun Sep 05 14:26:20 GMT 2004
>Last-Modified:  Sun Sep 05 14:26:20 GMT 2004
>Originator:     Val P
>Release:        5.2.1
>Organization:
>Environment:
FreeBSD mbox 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Sat May 29 09:11:27 CDT 2004     root@mbox:/usr/obj/usr/src/sys/mboxx  i386

>Description:
I installed FreeBSD 5.2.1 then samba 3.0.4 from source (I was unable to install the samba 3.0.x from ports, it keeps failing with ec = -1).  I attached an older 80GB drive as /library. I created 10 files in notepad on windows XP Pro. They are just text files, with the sequence 0-9 repeated six times per line, then repeated for about 200,000 lines, giving me 10 identical files of about 16 mb. Exported my fat drive as /fat, and my /tmp drive as /ufs. Ran a copy from windows:

copy testfile* \\computername\fat <file://computername/fat> 

and

copy testfile* \\computername\ufs <file://computername/ufs> 

in my tmp (the /ufs share), the ten files were identical. On my fat drive (the /fat share), none of the ten files were identical to each other. The size was the same, but the data inside was scrambled, after a few correct blocks at the beginning. Using the /V flag on xcopy didn't signal any errors, but doing an fc /b after the copy from the windows machine showed a lot of differences. There were no errors while copyin to the ufs share, but coping to the fat share I get tons of the following in the samba.machine log:

[2004/06/02 00:41:53, 0] locking/posix.c:posix_fcntl_lock(657)

posix_fcntl_lock: WARNING: lock request at offset 0, length 92233720368547758\

08 returned

[2004/06/02 00:41:53, 0] locking/posix.c:posix_fcntl_lock(658)

an Invalid argument error. This can happen when using 64 bit lock offsets

[2004/06/02 00:41:53, 0] locking/posix.c:posix_fcntl_lock(659)

on 32 bit NFS mounted file systems.

[2004/06/02 00:41:53, 0] locking/posix.c:posix_fcntl_lock(673)

Count greater than 31 bits - retrying with 31 bit truncated length.

[2004/06/02 00:41:54, 0] locking/posix.c:posix_fcntl_lock(657)

posix_fcntl_lock: WARNING: lock request at offset 0, length 16580 returned

[2004/06/02 00:41:54, 0] locking/posix.c:posix_fcntl_lock(658)

an Invalid argument error. This can happen when using 64 bit lock offsets

[2004/06/02 00:41:54, 0] locking/posix.c:posix_fcntl_lock(659)

on 32 bit NFS mounted file systems.

[2004/06/02 00:41:54, 0] locking/posix.c:posix_fcntl_lock(657)

posix_fcntl_lock: WARNING: lock request at offset 16580, length 16580 returne\ D

Note that I'm not using NFS at all. This is a 32-bit machine. NFSCLIENt and NFSSERver is commented out in the kernel config file. If I set posix locks to off in he smb.conf, these messages go away but the corruption is still there.

>How-To-Repeat:
See description.

>Fix:
wish I knew. I had no replies from freebsd-questions or freebsd-fs, so I'm dumping it here and abandoning freebsd for this particular project.


>Release-Note:
>Audit-Trail:

From: Tim Robbins <tjr@freebsd.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/67555: fat32 corruption when using samba
Date: Sun, 5 Sep 2004 17:02:54 +1000

 Following up to note that ports/67721 has been closed as a duplicate of
 this PR.
State-Changed-From-To: open->closed 
State-Changed-By: tjr 
State-Changed-When: Sun Sep 5 14:25:45 GMT 2004 
State-Changed-Why:  
Duplicate of kern/39043. 

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