Bug 24393

Summary: Patch to msdosfs to handle a kind of incorrect filesystems
Product: Base System Reporter: semenu <semenu>
Component: kernAssignee: Tom Rhodes <trhodes>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description semenu freebsd_committer freebsd_triage 2001-01-16 20:20:04 UTC
There are sometimes a FAT filesystems not handled correctly by msdosfs 
driver, but handled by mtools and other OSes. The problem is that 
msdosfs assume . entry in directory have cluster number set to real 
directory cluster number. But sometimes cluster number for . entry is 
set to 0, and msdosfs behaves wrong with such filesystems.

Fix: Use following patch:
How-To-Repeat: Take a FAT12 formatted diskette image from vmware2 distribution 
(vmware-distrib/lib/floppies/windows.flp): 
without patch:

# ls -lR /floppy
ls: win2k: directory causes a cycle
ls: win9x: directory causes a cycle
ls: winnt: directory causes a cycle
total 850
-rwxr-xr-x  1 root  wheel  870002 Nov  1 17:36 VMwareTools.exe
drwxr-xr-x  1 root  wheel       0 Nov  1 17:36 win2k
drwxr-xr-x  1 root  wheel       0 Nov  1 17:36 win9x
drwxr-xr-x  1 root  wheel       0 Nov  1 17:36 winnt

with patch:
# ls -lR /floppy
total 852
-rwxr-xr-x  1 root  wheel  870002 Nov  1 17:36 VMwareTools.exe
drwxr-xr-x  1 root  wheel     512 Nov  1 17:36 win2k
drwxr-xr-x  1 root  wheel     512 Nov  1 17:36 win9x
drwxr-xr-x  1 root  wheel     512 Nov  1 17:36 winnt

/floppy/win2k:
total 28
-rwxr-xr-x  1 root  wheel  18432 Nov  1 17:36 vmx_fb.dll
-rwxr-xr-x  1 root  wheel   2274 Nov  1 17:36 vmx_svga.inf
-rwxr-xr-x  1 root  wheel   7440 Nov  1 17:36 vmx_svga.sys

/floppy/win9x:
total 25
-rwxr-xr-x  1 root  wheel  17136 Nov  1 17:36 VMX_SVGA.DRV
-rwxr-xr-x  1 root  wheel   5991 Nov  1 17:36 VMX_SVGA.vxd
-rwxr-xr-x  1 root  wheel   1669 Nov  1 17:36 vmx_svga.inf

/floppy/winnt:
total 38
-rwxr-xr-x  1 root  wheel  17408 Nov  1 17:36 vmx_fb.dll
-rwxr-xr-x  1 root  wheel  13637 Nov  1 17:36 vmx_svga.inf
-rwxr-xr-x  1 root  wheel   7440 Nov  1 17:36 vmx_svga.sys
Comment 1 Tom Rhodes freebsd_committer freebsd_triage 2002-08-16 06:15:06 UTC
State Changed
From-To: open->patched

Hello.  I have just applied this patch, thank you. 


Comment 2 Tom Rhodes freebsd_committer freebsd_triage 2002-08-16 06:15:06 UTC
Responsible Changed
From-To: freebsd-bugs->trhodes

Hello.  I have just applied this patch, thank you.
Comment 3 Tom Rhodes freebsd_committer freebsd_triage 2002-08-22 17:20:29 UTC
State Changed
From-To: patched->closed

Patch applied to stable!  Thanks for your submission.