vfat write wrong value into lcase flag
PATCH 1/1 vfat write wrong value into lcase flag
Hi,
The current vfat is writeing wrong value into lcase flag. It is writing the lowercase flag, although filename is uppercase.
Please apply.
Signature · 14 lines
OGAWA Hirofumi <[email protected]> diff -urN linux-2.4.8-pre6/fs/vfat/namei.c vfat_lcase-2.4.8-pre6/fs/vfat/namei.c --- linux-2.4.8-pre6/fs/vfat/namei.c Sat Apr 7 02:51:19 2001 +++ vfat_lcase-2.4.8-pre6/fs/vfat/namei.c Thu Aug 9 00:07:39 2001 @@ -1056,7 +1056,7 @@ (*de)->starthi = 0; (*de)->size = 0; (*de)->attr = is_dir ? ATTR_DIR : ATTR_ARCH; - (*de)->lcase = CASE_LOWER_BASE | CASE_LOWER_EXT; + (*de)->lcase = 0; fat_mark_buffer_dirty(sb, *bh);
On 09 Aug 2001 00:30:58 +0900 OGAWA Hirofumi <[email protected]> wrote:
OH> The current vfat is writeing wrong value into lcase flag. It is OH> writing the lowercase flag, although filename is uppercase.
Hello,
In December 1999 I sent my investigation about short filenames in vfat:
_________________________________________
Hello,
there were some complaints about linux not handling upper/lowercase filenames in vfat correctly (they are below). So I did some investigation. I created following directories (or files, it does not matter):
in Linux: LINUP, linlow
in win98: 98UP, 98low
in NT4: NTUP, ntlow
in W2k: W2KUP, w2klow
Now what ls/dir shows:
in Linux: LINUP, linlow, 98up, 98low, ntup, ntlow, w2kup, w2klow in win98: LINUP, LINLOW, 98UP, 98low, NTUP, NTLOW, W2KUP, W2KLOW in NT4: LINUP, linlow, 98UP, 98low, NTUP, ntlow, W2KUP, w2klow in W2K: LINUP, linlow, 98UP, 98low, NTUP, ntlow, W2KUP, w2klow
So I would suggest NT/W2K shows everything correctly (if we can call so, because microsoft mixed everything up), and win98/Linux shows differently in opposite directions. I think Linux should follow one of win95/98 or NT/W2K, and since NT/W2K seams more reasonable, Linux could display filenames like NT (Linux creates filenames similar to NT already).
There is no such problem with mixed up/low or with filenames containing more than 8 characters.
_________________________________________
I like this table format better, with errors marked:
in Linux: LINUP linlow <98up> 98low <ntup> ntlow in win98: LINUP <LINLOW> 98UP 98low NTUP <NTLOW> in NT4: LINUP linlow 98UP 98low NTUP ntlow
Clearly NT displays everything right.
Lowercase must be written the Win98 way.
Uppercase must be written the Linux way.
_________________________________________
Then I sent a diskette image to Al Viro:
Quoted 2 lines
I am sending diskette image, made with
dd if=/dev/fd0 of=fdd_vfat bs=512 count=2847
Aha... In other words, for NT in short records bit 3 at offset 0xc means 'lowercase it'. 9x ignores the thing. Everybody handle the long entries the same way. Umhm... Thanks.
_________________________________________
I think Linux should create files like win98 (because NT shows them correctly) and show like NT.
Regards,
Nerijus
Quoted 8 lines · Nerijus Baliunas
On 09 Aug 2001 00:30:58 +0900 OGAWA Hirofumi <[email protected]> wrote:
OH> The current vfat is writeing wrong value into lcase flag. It is OH> writing the lowercase flag, although filename is uppercase.
Hello,
In December 1999 I sent my investigation about short filenames in vfat:
[...]
Quoted 3 lines
I think Linux should create files like win98 (because NT shows them correctly) and show like NT.
The _current vfat_ uses the following rule.
name attribute used direntry
-----------------------------------------------------------------------------
foo.txt LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 foo.TXT LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 FOO.txt LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 FOO.TXT , CASE_LOWER_BASE | CASE_LOWER_EXT 1 Foo.TXT LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 FOO.Txt LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2
I missed something?
Signature · 1 line
OGAWA Hirofumi <[email protected]>
On 10 Aug 2001 03:16:34 +0900 OGAWA Hirofumi <[email protected]> wrote:
OH> Nerijus Baliunas <[email protected]> writes:
OH>
OH> > On 09 Aug 2001 00:30:58 +0900 OGAWA Hirofumi <[email protected]> wrote:
OH> >
OH> > OH> The current vfat is writeing wrong value into lcase flag. It is OH> > OH> writing the lowercase flag, although filename is uppercase.
OH> >
OH> > Hello,
OH> >
OH> > In December 1999 I sent my investigation about short filenames in vfat:
OH>
OH> [...]
OH>
OH> > I think Linux should create files like win98
OH> > (because NT shows them correctly) and show like NT.
OH>
OH> The _current vfat_ uses the following rule.
OH>
OH> name attribute used direntry
OH> -----------------------------------------------------------------------------
OH> foo.txt LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 OH> foo.TXT LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 OH> FOO.txt LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 OH> FOO.TXT , CASE_LOWER_BASE | CASE_LOWER_EXT 1 OH> Foo.TXT LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 OH> FOO.Txt LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2
OH>
OH> I missed something?
I don't know. Sorry, I didn't look at the code, but current (2.4.7) kernel still shows filenames as I wrote in 1999. I am talking about filenames _without_ long entries. Didn't test what current kernel writes, though.
I'm attaching floppy image, ungzip and loop mount it.
Regards,
Nerijus
Quoted 4 lines · Nerijus Baliunas
I don't know. Sorry, I didn't look at the code, but current (2.4.7) kernel still shows filenames as I wrote in 1999. I am talking about filenames _without_ long entries. Didn't test what current kernel writes, though.
I'm attaching floppy image, ungzip and loop mount it.
Thanks for sending floppy image.
This floppy image contains following directory entry:
(this floppy image forgot testing extension name)
name attribute used direntry
-----------------------------------------------------------------------------
LINUP LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2 LINLOW , CASE_LOWER_BASE | CASE_LOWER_EXT 1 DOSUP , 1 DOSLOW , 1 98UP , 1 98low LONG_FILENAME, 2 W2KUP , 1 W2KLOW , CASE_LOWER_BASE 1 NTUP , 1 NTLOW , CASE_LOWER_BASE 1
linux-2.4.8-pre8:
-----------------------------------------------------------------------------
LINUP , CASE_LOWER_BASE | CASE_LOWER_EXT 1 linlow LONG_FILENAME, CASE_LOWER_BASE | CASE_LOWER_EXT 2
default, convert the shortname to lowercase:
$ mount -t vfat fdd_vfat /mnt -o loop $ ls /mnt 98low 98up LINUP doslow dosup linlow ntlow ntup w2klow w2kup
nocase option, use the win9x rule for display (doesn't support CASE_* flags):
$ mount -t vfat fdd_vfat /mnt -o loop,nocase $ ls /mnt 98UP 98low DOSLOW DOSUP LINLOW LINUP NTLOW NTUP W2KLOW W2KUP
2.4.8-pre8 is useing the win9x rule for create. But attribute must change to 0.
Now, I writing the lower/win95/winnt/mixed rule on -ac tree. Please help to test the following patch, if you interests.
Signature · 1 line
OGAWA Hirofumi <[email protected]>