Subject: msdosfs directory bug -- any helpers out there?
To: None <>
From: Brian Buhrow <>
List: current-users
Date: 11/01/2005 19:21:31
	Hello.   I'm running NetBSD-2.0/I386 on a machine, and using the msdos
filesystem on a CF card which I use in a portable MP3 player.  I have traced
a directory coruption problem down to NetBSD, but I could use a little
advice on how to further isolate the problem and fix the bug.

	The problem seems to have to do with the insertion and deletion of
directory entries.  Although this activity seems to work fine with respect
to using files under NetBSD and Windows XP, the little MP3 player keeps
complaining of corrupt directories and files when those directories are
manipulated by NetBSD, but doesn't complain when Windows XP manipulates the
same directories.

	The problem seems to crop up if I put files into a directory, remove
some, and then add more files to that directory.  It's as if NetBSD doesn't
completely clean up the directory from the MP3 player's perspective, but
Windows does.

	I've got a kernel built with options MSDOSFS_DEBUG enabled, and have
been excercising a DOS filesystem, but at am a little loss as to where to
look.  It looks like the createde() and removede() functions are promising
places to begin, but I wondered if anyone else had any ideas.

	Some questions off the top of my head, to begin with.

1.  Has anyone else seen strange behavior when getting their portable
devices to read msdos filesystems maintained by NetBSD?

2. If so, did you find any work arounds?

3.  Are there any known obvious differences between the way NetBSD and
Windows leave directory entries after they're created or deleted?  Does
windows clear the attributes field in a deleted directory entry, for
example, while NetBSD does not?

	I am happy to work on this problem, if someone is willing to provide
advice and suggestions on the finer points of msdos filesystem semantics.
Otherwise, any help would be greatly appreciatd.