Subject: msdosfs: writes incorrect directory entries for non-FAT32 filesystems
To: None <>
From: Brian Buhrow <>
List: current-users
Date: 11/04/2005 12:13:25
	Hello folks. I've just submitted kern/32003, with a patch, to
correct a problem with the msdsosfs code for non-FAT32 filesystems.
The problem is that the code doesn't explicitly set deHighClust in the
directory entry if the filesystem is not FAT32.  As a result, random data
gets written to disk in this slot in the directory entry, and while MS
Windows and NetBSD don't care, because it's not used if it's not FAT32,
there are portable devices which don't properly ignore this data.  The
patch I've submitted explicitly sets the deHIghClust bytes to 0 if the
filesystem is not FAT32.
	If you've been trying to use a portable device with NetBSD's msdosfs
code, and found that sometimes it works, and sometimes it doesn't, and the
device is using a FAT16 filesystem, you're probably running into this bug.
Inspection suggests that this bug also affects the FreeBSD msdosfs code.
I've not looked at the OpenBSD code, but it wouldn't surprise me if it were
there too.
	If someone could look at this patch and commit it to -current, netbsd-3
and netbsd-2, that would be great.  I realize it's too late for the next
binary release of 2.x, but it would be nice if it were in the 2.x tree, and
and in the 3.0 binary releases.  I've tested the patch, and it makes my MP3
player much happier.