From owner-freebsd-bugs Sat Jun 8 13:20:27 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 365D437B40C for ; Sat, 8 Jun 2002 13:20:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g58KK6I51320; Sat, 8 Jun 2002 13:20:06 -0700 (PDT) (envelope-from gnats) Received: from nwww.freebsd.org (www.FreeBSD.org [216.136.204.117]) by hub.freebsd.org (Postfix) with ESMTP id 8350537B404 for ; Sat, 8 Jun 2002 13:18:52 -0700 (PDT) Received: from www.freebsd.org (localhost [127.0.0.1]) by nwww.freebsd.org (8.12.2/8.12.2) with ESMTP id g58KIphG011938 for ; Sat, 8 Jun 2002 13:18:51 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.2/8.12.2/Submit) id g58KIptL011937; Sat, 8 Jun 2002 13:18:51 -0700 (PDT) Message-Id: <200206082018.g58KIptL011937@www.freebsd.org> Date: Sat, 8 Jun 2002 13:18:51 -0700 (PDT) From: Evgeny zislis To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/39043: Corrupted files on a FAT32 partition Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 39043 >Category: kern >Synopsis: Corrupted files on a FAT32 partition >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jun 08 13:20:05 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Evgeny zislis >Release: FreeBSD 4.6-RC >Organization: >Environment: FreeBSD finone.ulp.co.il 4.6-RC FreeBSD 4.6-RC #4: Fri May 24 18:24:45 IDT 2002 kesor@finone.km.dshapiro.org:/usr/obj/usr/src/sys/FINONE i386 >Description: I have a WDC 80G hard drive, one primarly dos partition formatted as FAT32. It is mounted as /storage. I am using samba (2.2.4_1) to share this directory to windows machines on the network. Copying files from and to this partition works good, using smbclient 'get' command to get files from remote machines and put them in the shared mount point with the samba protocol doesnt do any problems. On another UFS partition samba has no problems, it only occures with the case of FAT32 partition. (thus why samba people tell me its not a samba issue, but rather msdosfs kernel module bug) The problem occures when using a windows machine, to copy files to the shared storage folder via the network. When using \\machinename\storage in windows and writing to it - some parts of the file get overriden with 0roes. I have used a 16mb file of random data, and from the hex dump its almost always more or less the same areas that are overriden with zeroes on the copied file : 080000-084000 100000-104000 180000-184000 200000-204000 280000-284000 d20000-end of file 1000000 I tested it in two completely different environments and networks, with completely different hardware and software that loosly matches my own configuration -- the problem repeats itself. >How-To-Repeat: 80G hard drive, formatted as FAT32, mounted as msdosfs in FreeBSD. samba port (2.2.4_1) installed and configured to share that mount point over the network. Take a file (the bigger the better, 10 bytes file didnt corrupt, while 3mb mp3s were getting corrupt 100% of the time) Using a windows machine, open the shared samba mount and copy a file to it, then check it with md5 to see that it's changed. >Fix: No known fix. there is a clue though, in /sys/msdosfs_vnops.c : line 708 * If the offset we are starting the write at is beyond the end of * the file, then they've done a seek. Unix filesystems allow * files with holes in them, DOS doesn't so we must fill the hole * with zeroed blocks. if (uio->uio_offset > dep->de_FileSize) { error = deextend(dep, uio->uio_offset, cred); the bug is possible hiding in deextend or somewhere around it. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message