public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* fat32 all upper-case filename problem
@ 2004-04-04 22:49 James Vega
  2004-04-05 10:30 ` Marco Roeland
  2004-04-05 13:02 ` OGAWA Hirofumi
  0 siblings, 2 replies; 6+ messages in thread
From: James Vega @ 2004-04-04 22:49 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1052 bytes --]

I've run across an interesting problem with creating all upper-case 
files/direcotries on fat32 partitions.  After creating a file in all upper-case, 
I can access it for a short time using either the all upper-case name or the all 
lower-case name.  After a short amount of time (or a umount/mount), I can only 
access the file via the all lower-case name.  I'm currently using kernel 2.6.4, 
but I've been seeing this since at least November of last year.

I've talked to a few people to see if anyone else can reproduce this and so far, 
I'm the only one that has been able to (save for the person that reported this 
bug http://bugs.xiph.org/show_bug.cgi?id=413).  Please CC any replies to me as I 
am not subscribed to the list.

Thanks,
James Vega

Example:

debil% touch /usbdrive/CASE
debil% ls /usbdrive
case
debil% ls /usbdrive/CASE
/usbdrive/CASE
debil% ls /usbdrive/case
/usbdrive/case
debil% umount /usbdrive && mount /usbdrive
debil% ls /usbdrive/case
/usbdrive/case
debil% ls /usbdrive/CASE
ls: /usbdrive/CASE: No such file or directory

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 264 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fat32 all upper-case filename problem
  2004-04-04 22:49 fat32 all upper-case filename problem James Vega
@ 2004-04-05 10:30 ` Marco Roeland
  2004-04-05 19:40   ` James Vega
  2004-04-05 13:02 ` OGAWA Hirofumi
  1 sibling, 1 reply; 6+ messages in thread
From: Marco Roeland @ 2004-04-05 10:30 UTC (permalink / raw)
  To: James Vega; +Cc: linux-kernel

On Sunday April 4th 2004 James Vega wrote:

> I've run across an interesting problem with creating all upper-case 
> files/direcotries on fat32 partitions.  After creating a file in all 
> upper-case, I can access it for a short time using either the all 
> upper-case name or the all lower-case name.  After a short amount of time 
> (or a umount/mount), I can only access the file via the all lower-case 
> name.  I'm currently using kernel 2.6.4, but I've been seeing this since at 
> least November of last year.
> 
> Example:
 
You forgot a 'ls /usbdrive' *before* the 'touch'. Now we don't know
whether it was empty before. We'll assume so.

> debil% touch /usbdrive/CASE
> debil% ls /usbdrive
> case

This suggests that you've mounted your usbdrive (vfat probably?)
_specifically_ with the option to force lowercase filenames. The default
is to preserve the case of the filename (to the filename *should* be CASE here)
and to see both names as equals.

Another possibility is that there *was* already a file called 'case' and
that the actual writing of the 'CASE' file in the directory is postponed
until some sort of 'sync' operation. This also would need a
specific 'case-sensitive' mount option.

> debil% ls /usbdrive/CASE
> /usbdrive/CASE
> debil% ls /usbdrive/case
> /usbdrive/case

The above normally can only happen if there really are *two* files, one
name 'case' and the other 'CASE'. So a case sensitive filesystem.

> debil% umount /usbdrive && mount /usbdrive
> debil% ls /usbdrive/case
> /usbdrive/case
> debil% ls /usbdrive/CASE
> ls: /usbdrive/CASE: No such file or directory

Looks like you have mounted the thing with case-sensitiviy *and* forcing
lowercase filenames always. Either there is a bug in the combination,
or perhaps there is a bug in that the uppercase name is cached for some
time in VFS until the lowercase name is reread from the usbdrive?

When you test this please be very careful to reproduce every start and
end condition *exactly*. <Bad pun alert> It's very easy to look at
Heisenbugs here, with all these virtual filenames in case space. </Bad
pun alert>

In practice I'd suggest using default mount options, except perhaps the
'uid=', 'gid=' and 'umask='.
-- 
Marco Roeland

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fat32 all upper-case filename problem
  2004-04-04 22:49 fat32 all upper-case filename problem James Vega
  2004-04-05 10:30 ` Marco Roeland
@ 2004-04-05 13:02 ` OGAWA Hirofumi
  2004-04-05 19:44   ` James Vega
  1 sibling, 1 reply; 6+ messages in thread
From: OGAWA Hirofumi @ 2004-04-05 13:02 UTC (permalink / raw)
  To: James Vega; +Cc: linux-kernel

James Vega <vega_james@lycos.com> writes:

> debil% touch /usbdrive/CASE
> debil% ls /usbdrive
> case
> debil% ls /usbdrive/CASE
> /usbdrive/CASE
> debil% ls /usbdrive/case
> /usbdrive/case
> debil% umount /usbdrive && mount /usbdrive
> debil% ls /usbdrive/case
> /usbdrive/case
> debil% ls /usbdrive/CASE
> ls: /usbdrive/CASE: No such file or directory

Are you using the "iocharset=utf8" or CONFIG_NLS_DEFAULT="utf8"?
If so, it's buggy.

Please don't use it for now.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fat32 all upper-case filename problem
  2004-04-05 10:30 ` Marco Roeland
@ 2004-04-05 19:40   ` James Vega
  0 siblings, 0 replies; 6+ messages in thread
From: James Vega @ 2004-04-05 19:40 UTC (permalink / raw)
  To: Marco Roeland; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]

Marco Roeland wrote:
> You forgot a 'ls /usbdrive' *before* the 'touch'. Now we don't know
> whether it was empty before. We'll assume so.

Sorry. Yes, the directory was empty before the 'touch'.

>>debil% touch /usbdrive/CASE
>>debil% ls /usbdrive
>>case
> 
> 
> This suggests that you've mounted your usbdrive (vfat probably?)
> _specifically_ with the option to force lowercase filenames. The default
> is to preserve the case of the filename (to the filename *should* be CASE here)
> and to see both names as equals.

Here is the output from the 'mount' command:

/dev/sda1 on /usbdrive type vfat (rw,noexec,nosuid,nodev,uid=1000,gid=1000)

AFAIK, I did nothing to force lowercase filenames.

> Another possibility is that there *was* already a file called 'case' and
> that the actual writing of the 'CASE' file in the directory is postponed
> until some sort of 'sync' operation. This also would need a
> specific 'case-sensitive' mount option.
> 
> 
>>debil% ls /usbdrive/CASE
>>/usbdrive/CASE
>>debil% ls /usbdrive/case
>>/usbdrive/case
> 
> 
> The above normally can only happen if there really are *two* files, one
> name 'case' and the other 'CASE'. So a case sensitive filesystem.

There was only one file as shown by the ls output above.  Also, the few people 
that I have asked to reproduce this are always able to ls both 'case' and 'CASE' 
even after a remount or waiting for the cached entry to expire.

>>debil% umount /usbdrive && mount /usbdrive
>>debil% ls /usbdrive/case
>>/usbdrive/case
>>debil% ls /usbdrive/CASE
>>ls: /usbdrive/CASE: No such file or directory
> 
> 
> Looks like you have mounted the thing with case-sensitiviy *and* forcing
> lowercase filenames always. Either there is a bug in the combination,
> or perhaps there is a bug in that the uppercase name is cached for some
> time in VFS until the lowercase name is reread from the usbdrive?

Again, I'm not knowingly specifying either case-sensitivity or forced lowercase 
filenames.  The line in /etc/fstab is as follows:
/dev/sda1 /usbdrive auto (rw,noexec,nosuid,nodev,uid=1000,gid=1000) 0 0

> When you test this please be very careful to reproduce every start and
> end condition *exactly*. <Bad pun alert> It's very easy to look at
> Heisenbugs here, with all these virtual filenames in case space. </Bad
> pun alert>

Thank you for the suggestions. I'll keep these in mind for future testing.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 264 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fat32 all upper-case filename problem
  2004-04-05 13:02 ` OGAWA Hirofumi
@ 2004-04-05 19:44   ` James Vega
  2004-04-05 21:39     ` James Vega
  0 siblings, 1 reply; 6+ messages in thread
From: James Vega @ 2004-04-05 19:44 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

OGAWA Hirofumi wrote:
  > Are you using the "iocharset=utf8" or CONFIG_NLS_DEFAULT="utf8"?
> If so, it's buggy.
> 
> Please don't use it for now.

I am using CONFIG_NLS_DEFAULT="utf8". I'll see if I get the same results that 
changed back to iso8859-1.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 264 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fat32 all upper-case filename problem
  2004-04-05 19:44   ` James Vega
@ 2004-04-05 21:39     ` James Vega
  0 siblings, 0 replies; 6+ messages in thread
From: James Vega @ 2004-04-05 21:39 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

James Vega wrote:
> OGAWA Hirofumi wrote:
>  > Are you using the "iocharset=utf8" or CONFIG_NLS_DEFAULT="utf8"?
> 
>> If so, it's buggy.
>>
>> Please don't use it for now.
> 
> 
> I am using CONFIG_NLS_DEFAULT="utf8". I'll see if I get the same results 
> that changed back to iso8859-1.

Now I am able to ls both 'case' and 'CASE' even though an ls of the directory 
shows 'case'.  Thanks.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 264 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-04-05 21:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-04 22:49 fat32 all upper-case filename problem James Vega
2004-04-05 10:30 ` Marco Roeland
2004-04-05 19:40   ` James Vega
2004-04-05 13:02 ` OGAWA Hirofumi
2004-04-05 19:44   ` James Vega
2004-04-05 21:39     ` James Vega

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox