From owner-freebsd-bugs Wed Jan 22 10:30:11 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 941A837B401 for ; Wed, 22 Jan 2003 10:30:07 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2447943F5B for ; Wed, 22 Jan 2003 10:30:07 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h0MIU3NS082008 for ; Wed, 22 Jan 2003 10:30:03 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h0MIU3na082002; Wed, 22 Jan 2003 10:30:03 -0800 (PST) Date: Wed, 22 Jan 2003 10:30:03 -0800 (PST) Message-Id: <200301221830.h0MIU3na082002@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Stas Kysel Subject: Re: kern/39043: Corrupted files on a FAT32 partition Reply-To: Stas Kysel 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 The following reply was made to PR kern/39043; it has been noted by GNATS. From: Stas Kysel To: freebsd-gnats-submit@FreeBSD.org, kesor@ulp.co.il Cc: Subject: Re: kern/39043: Corrupted files on a FAT32 partition Date: Wed, 22 Jan 2003 20:21:10 +0200 Hi. Looks like samba guys are right - this is a bug in kernel, not in samba or windows :( ktrace/kdump shows that file (which appears corrupt on disk) was: 1. opened: CALL open(0x81c1220,0xa02,0x1f4) 2. truncated: CALL ftruncate(0x13,0,0xbb0fb,0) then several times 3. seeked to corresponding offset (0,0x10000,0x20000,...): CALL lseek(0x13,0,0,0,0) CALL lseek(0x13,0,0x10000,0,0) ... 4. written by 64k chunks of data (not zeroes), except last write which was smaller of course: CALL write(0x13,0x8229045,0x10000) CALL write(0x13,0x8229045,0x10000) ... 5. Then closed write() was always successful: RET write 65536/0x10000 Corruption is another type this time on all checked files - only first 32k are filled with data, the rest of file is zeroed. In addition it was stat()-ed several times and chmod() was tried on it, but unsuccessfully, because FAT32 does not support it. Not posting full kdump output here for brevity, but if someone wants to check me, I'll E-mail him corresponding parts of it. df output: ... /dev/ad2s1 39108736 7708608 31400128 20% /share What can I do to help you to resolve this issue? Thank you for your attention. I've heard dmesg output is necessary. Not sure if it can help here, but just in case: --------------------------------------------------------------------------- Copyright (c) 1992-2002 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 4.7-RELEASE #3: Thu Jan 9 12:23:15 EET 2003 stas@localhost:/usr/src/sys/compile/kernel Timecounter "i8254" frequency 1193182 Hz CPU: Pentium II/Pentium II Xeon/Celeron (434.32-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x665 Stepping = 5 Features=0x183f9ff real memory = 133103616 (129984K bytes) config> di pcic0 No such device: pcic0 Invalid command or syntax. Type `?' for help. config> di sn0 No such device: sn0 Invalid command or syntax. Type `?' for help. config> di lnc0 No such device: lnc0 Invalid command or syntax. Type `?' for help. config> di ie0 No such device: ie0 Invalid command or syntax. Type `?' for help. config> di fe0 No such device: fe0 Invalid command or syntax. Type `?' for help. config> di ed0 No such device: ed0 Invalid command or syntax. Type `?' for help. config> di cs0 No such device: cs0 Invalid command or syntax. Type `?' for help. config> di bt0 No such device: bt0 Invalid command or syntax. Type `?' for help. config> di aic0 No such device: aic0 Invalid command or syntax. Type `?' for help. config> di aha0 No such device: aha0 Invalid command or syntax. Type `?' for help. config> di adv0 No such device: adv0 Invalid command or syntax. Type `?' for help. config> q avail memory = 126320640 (123360K bytes) Preloaded elf kernel "kernel" at 0xc0326000. Preloaded userconfig_script "/boot/kernel.conf" at 0xc032609c. Pentium Pro MTRR support enabled npx0: on motherboard npx0: INT 16 interface pcib0: on motherboard pci0: on pcib0 pci0: at 1.0 irq 7 pcib1: at device 30.0 on pci0 pci1: on pcib1 dc0: port 0xc000-0xc0ff mem 0xdd000000-0xdd0000ff irq 7 at device 0.0 on pci1 dc0: Ethernet address: 00:80:ad:7e:2e:a4 miibus0: on dc0 dcphy0: on miibus0 dcphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto rl0: port 0xc400-0xc4ff mem 0xdd001000-0xdd0010ff irq 5 at device 2.0 on pci1 rl0: Ethernet address: 00:50:ba:83:6d:54 miibus1: on rl0 rlphy0: on miibus1 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto isab0: at device 31.0 on pci0 isa0: on isab0 atapci0: port 0xf000-0xf00f at device 31.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 pci0: at 31.2 irq 12 pcm0: port 0xdc00-0xdc3f,0xd800-0xd8ff irq 11 at device 31.5 on pci0 orm0: