Panic with msdosfs vs 1.3TB FAT32

Mario Sergio Fujikawa Ferreira lioux-list at uol.com.br
Sat Oct 9 12:35:31 UTC 2010


On 06/10/2010 12:01, Paul B Mahol wrote:
 > On 10/6/10, Mario Sergio Fujikawa Ferreira<lioux-list at uol.com.br>  wrote:
 >> On 06/10/2010 00:36, Paul B Mahol wrote:
 >>> On 10/6/10, Mario Sergio Fujikawa Ferreira<lioux-list at uol.com.br> 
  wrote:
 >>>> Hi,
 >>>>
 >>>> 	I mounted a 1.3TB FAT32 (32k cluster) filesystem on esata
 >>>> /dev/ada4s1 under /media/esata/ with the '-l' (large option).
 > What FreeBSD version is this and how many files that fs have?

   csup, make world 8-STABLE on 07 October, 2010.

$ uname -a
FreeBSD exxodus.fedaykin.here 8.1-STABLE FreeBSD 8.1-STABLE #1: Thu Oct 
  7 22:45:57 BRT 2010     lioux at exxodus:/usr/obj/usr/src/sys/LIOUX  amd64

Filesystem     1K-blocks        Used     Avail Capacity  Mounted on
/dev/ada4s1    1464778560 1189423520 275355040    81%    /media/esata

Number of files				4595
File size average in bytes		517580,14
File size standard deviation in bytes	745362,08
File size variance in bytes		555564632228,95
Smaller file size in bytes		23
Largest file size in bytes		3681407635

Smaller inode number			11446148
Largest inode number			4026536433

   A complete textdump is available at

http://people.freebsd.org/~lioux/panic/2010100500/textdump.tar.2

   Let me know if you need further information.

 >>>> 	I tried to create a directory and files but got errors:
 >
 > If you mount it read only, can you read all files?

   I can read files (tried md5 checksum on 20 files) whether I mount it 
read only or not. I have the md5 checksum of those files saved elsewhere 
for comparison purposes.

   The problem only arise when I try to do a write operation.

 > This could eat all memory if there are many small files....
 > But it can be useful to know if you can read files with different
 > inodes (or whatever FAT calls it)

   I tried reading several files of 4Gb size each. No problem.

 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247646208, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247646208, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247613440, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247646208, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247613440, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247580672, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247646208, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247613440, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247580672, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247646208, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247613440, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247580672, 
length=32768)]error = 5
 >>>>
 >>>> ------
 >>>>
 >>>> 	Then, I tried unmounting the filesystem which resulted on
 >>>>
 >>>> ------
 >>>>
 >>>> fsync: giving up on dirty
 >>>> 0xffffff01bad6e1d8: tag devfs, type VCHR
 >>>>       usecount 1, writecount 0, refcount 38253 mountedhere
 >>>> 0xffffff00ac899600
 >>>>       flags ()
 >>>>       v_object 0xffffff008b839ca8 ref 0 pages 44786
 >>>>       lock type devfs: EXCL by thread 0xffffff016506cba0 (pid 76462)
 >>>>           dev ada4s1
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247646208, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247613440, 
length=32768)]error = 5
 >>>> g_vfs_done():ada4s1[WRITE(offset=-980247580672, 
length=32768)]error = 5
 >>>> fsync: giving up on dirty
 >>>> 0xffffff01bad6e1d8: tag devfs, type VCHR
 >>>>       usecount 1, writecount 0, refcount 38253 mountedhere
 >>>> 0xffffff00ac899600
 >>>>       flags ()
 >>>>       v_object 0xffffff008b839ca8 ref 0 pages 44786
 >>>>       lock type devfs: UNLOCKED
 >>>>           dev ada4s1
 >>>>
 >>>> Fatal trap 12: page fault while in kernel mode
 >>>> cpuid = 1; apic id = 01
 >>>> fault virtual address   = 0x4
 >>>> fault code              = supervisor read data, page not present
 >>>> instruction pointer     = 0x20:0xffffffff803e60e4
 >>>> stack pointer           = 0x28:0xffffff80e79ba860
 >>>> frame pointer           = 0x28:0xffffff80e79ba8a0
 >>>> code segment            = base 0x0, limit 0xfffff, type 0x1b
 >>>>                           = DPL 0, pres 1, long 1, def32 0, gran 1
 >>>> processor eflags        = interrupt enabled, resume, IOPL = 0
 >>>> current process         = 25 (syncer)
 >>>>
 >>>> ------
 >>>>
 >>>> 	The filesystem is clean since I find no errors under Windows
 >>>> ('chkdsk /f').
 >>>>
 >>>> 	I can otherwise mount, read and write on smaller FAT32
 >>>> filesystems.  I think there might be a problem with the handling
 >>>> of such a big FAT32 filesystem.
 >>>>
 >>>> 	A complete textdump is available at
 >>>>
 >>>> http://people.freebsd.org/~lioux/panic/2010100500/textdump.tar.2
 >>>>
 >>>> 	Is this kind of error expected? Is there anything I can do
 >>>> to help?
 >>>>
 >>>> 	I can reproduce this error with the 1.3TB fs easily.
 >>>
 >>> Comment in source claims that support for large fs are experimental
 >>> and safe only in read only mode.
 >>>
 >>> Looking at your output it is obvious that offset should not be 
negative...
 >>
 >>     Now that you mention it... :)
 >>
 >>     I guess I might have overflown some internal variable, possibly a 32
 >> bit integer.
 >>
 >>     I checked
 >>
 >> 
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/fs/msdosfs/msdosfs_vfsops.c?rev=1.199
 >>
 >> but it did not make much sense to me. :(
 >>
 >>     Any ideas where I might look or for a patch? Unfortunately, I am not
 >> kernel knowledgeable but I'll help however I can.
 >
> Something is very buggy with msdosfs and vfs.
>
> kern/93634 is clear example. I can reproduce it on i386.
>
> Note that I'm freebsd vfs/vm noob. So do not expect anything from me.

--
Mario S F Ferreira - DF - Brazil - "I guess this is a signature."
feature, n: a documented bug | bug, n: an undocumented feature


More information about the freebsd-fs mailing list