Re: [PATCH] VFAT fixes.

Alexander Viro (viro@math.psu.edu)
Fri, 15 Jan 1999 08:27:23 -0500 (EST)


On Fri, 15 Jan 1999, Albert D. Cahalan wrote:

>
> Alexander Viro writes:
> > On Fri, 15 Jan 1999, Albert D. Cahalan wrote:
>
> >> + /* Yes, it can happen. ".\xe5" would do it. */
> >> + if (IS_FREE(base))
> >> + base[0]='_';
> >>
> >>
> >> base[0] ought to become 0x05, not '_'
> >
> > OK, accepted. What would you propose for 0xf6? It's also covered
> > by IS_FREE stuff.
>
> Oh, that is a bug. Both DOS 6.22 and NT 4sp3 are happy with 0xf6.
> They can read and write 0xf6 in any character position, unlike Linux.

OK, then it should go into generic FAT part. I have similar fixes
for msdos and it would fit there quite fine. Msdos part is less
critical - with VFAT there were ways to corrupt the fs without races.
I will submit it in a day or so.

Albert, you worked with the FAT code before, could you look
through the fat_readdirx()? I have a nasty feeling that some cases are not
covered there. Dunno, maybe they can't happen on correct FAT-derived fs,
but the code is *messy*. Count local variables and the loop depth and
you'll see what I mean. Could you comment on it?

> I'd guess the 0xf6 bug is a leftover from Atari DOS support.
> The IS_FREE stuff would need to test for Atari format perhaps.

I'm somewhat concerned about the root directory on floppies. It
seems to me that some docs suggested that sector filled with 0xf6's is
kosher there.

> Note that 0x05 is only legal as a substitute for 0x05 in the first
> character slot. To save code, Linux could unconditionally translate
> when reading.

> On a read, NT does translation only for the first character.
> A manually created file with "\05\05-E-5" on disk will be displayed
> as "\xe5\05-E-5", but will not be accessible by any name.

> Clearly 0x05 must never appear in the short name except at the
> beginning as a substitute for 0xe5. NT can create and use a file
> with 0x05 anywhere by using the long name and '_' for mangling.

OK, then. For VFAT it means that it should (a) include 0x5 into
the replace_chars, (b) allow long names starting from 0xe5, (c) handle
that case in vfat_format_name. Lookup side of VFAT is in the
fat_readdirx(), so...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/