All of lore.kernel.org
 help / color / mirror / Atom feed
* Long file names in VFAT broken with iocharset=utf8
@ 2007-05-07 17:51 Andrey Borzenkov
  2007-05-07 18:07 ` Roland Kuhn
  0 siblings, 1 reply; 20+ messages in thread
From: Andrey Borzenkov @ 2007-05-07 17:51 UTC (permalink / raw)
  To: hirofumi; +Cc: linux-kernel

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

This was posted in one of Russian forums. It was not possible to archive 
(under Linux, using tar) vfat directory where files had long Russian names 
(really long - over 150 - 170 characters) - tar returned stat failure. When 
looking with plain ls, file names appeared truncated.

Now looking at current (2.6.21) fat driver, __fat_readdir allocates large 
enough buffer (PAGE_SIZE-522) for UTF-8 name; but for iocharset=utf8 it calls 
uni16_to_x8() which artificially limits length of UTF-8 name to 256 ... which 
is obviously not enough for long UTF-8 Russian string (2 bytes per character) 
not to mention the - theoretical - general case of 6 bytes UTF-8 characters.

Similar problem has apparently vfat_lookup()->...->fat_search_long() call 
chain. Except this appears to be broken even in case of "utf8", because 
fat_search_long allocates fixed 256 bytes buffer for UTF-8 name.

Am I off track here?

-andrey

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: Long file names in VFAT broken with iocharset=utf8
@ 2007-05-08  4:43 Albert Cahalan
  2007-05-08  8:38 ` Jan Engelhardt
  0 siblings, 1 reply; 20+ messages in thread
From: Albert Cahalan @ 2007-05-08  4:43 UTC (permalink / raw)
  To: arvidjaar, hirofumi, linux-kernel, hpa

Andrey Borzenkov writes:

> This was posted in one of Russian forums. It was not possible to
> archive (under Linux, using tar) vfat directory where files had
> long Russian names (really long - over 150 - 170 characters) - tar
> returned stat failure. When looking with plain ls, file names
> appeared truncated.

I have an idea to deal with this, but first a rant...

At two bytes per character, you get 127 characters in a filename.
That's wider than the standard 80-column display, and far wider
than the 28 or 29 characters that an "ls -l" has room for. In a
GUI file manager or file dialog box, you'll have to scroll sideways.
In a web browser directory listing, you'll almost certainly have
to scroll sideways. Must of this even applies to Windows tools.

In other words, this is user error. Somebody thought that a filename
was a place to store a document, probably a README file. What next,
shall we MIME-encode an icon into the filename?

Fix: the vfat driver should use the 8.3 name for such files.

^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <8ipOe-5KI-3@gated-at.bofh.it>]

end of thread, other threads:[~2007-05-10 16:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-07 17:51 Long file names in VFAT broken with iocharset=utf8 Andrey Borzenkov
2007-05-07 18:07 ` Roland Kuhn
2007-05-07 18:17   ` Andreas Schwab
2007-05-07 18:43     ` Andrey Borzenkov
2007-05-07 18:52       ` OGAWA Hirofumi
2007-05-07 18:27   ` OGAWA Hirofumi
2007-05-07 19:34     ` H. Peter Anvin
2007-05-07 19:59     ` Roland Kuhn
2007-05-07 21:01       ` OGAWA Hirofumi
2007-05-07 21:12       ` H. Peter Anvin
2007-05-09 10:27       ` Andrey Borzenkov
  -- strict thread matches above, loose matches on Subject: below --
2007-05-08  4:43 Albert Cahalan
2007-05-08  8:38 ` Jan Engelhardt
2007-05-09 15:34   ` Albert Cahalan
2007-05-09 15:57     ` Andrey Borzenkov
2007-05-09 23:49       ` Albert Cahalan
     [not found] <8ipOe-5KI-3@gated-at.bofh.it>
2007-05-08 16:21 ` Bodo Eggert
     [not found] ` <8ityz-2Xz-31@gated-at.bofh.it>
     [not found]   ` <8iWqS-5Ba-15@gated-at.bofh.it>
     [not found]     ` <8iWKp-619-29@gated-at.bofh.it>
     [not found]       ` <8j4eK-QR-13@gated-at.bofh.it>
2007-05-10 14:49         ` Bodo Eggert
2007-05-10 14:59           ` Jan Engelhardt
2007-05-10 16:14             ` John Anthony Kazos Jr.

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.