[PATCH]fs/vfat/namei.c dbcs fix,kernel 2.2.19

From: User (csoh@bgis.dyndns.org)
Date: Thu Oct 25 2001 - 01:52:59 EST


0. Which version the attached patch applies to

  2.2.19

1. What this patch supposed to fix

 1-1. Wrong case manipulation in namei.c
  From 2.2.18 namei.c uses toupper(), islower() to make uppercase
  shortname, and since it assumes the character range of 0xe0-0xff as
  lowercase, it broke the DBCS(double byte character set) character.
  This patch tries to acknowledge the codepage charset it currently uses
  and if the charset is one of DBCS charset, it uses (if (c>='a' ||
  c<='z') c = c - 32) instead. Non-DBCS charsets are not affected.

 1-2. Spliced doublebyte character shortname
  If filename longer than 8 byte base has doublebyte character in 6th and
  7th place, like

        'a' 'b' 'c' 'XY' 'XY' 'XY' '.' 'b' 'm' 'p'
  (X and Y means first and latter half of double byte character)

  Current implementation makes shortname like

        'A' 'B' 'C' 'XY' 'X' '~' '1' '.' 'B' 'M' 'P'

  which is different from DBCS windows implementation

        'A' 'B' 'C' 'XY' '~' '1' '.' 'B' 'M' 'P'

2. Tests

  Copy entire korean win95,98,Me fresh-installed partition to samba share
  to make original file set and make other computer that has both ext2
  linux partition and vfat partition. Boot this computer in linux, mount
  vfat partition and nfs partition (for original filesets) and copy these
  to vfat partition. Finally reboot to windows and run dir, scandisk,
  etc..

  without patch, scandisk complains at several spots and dir shows like
  this.

dir c:\windows\*.bmp

¹°¹Æ¿Ï BMP 190 96-10-30 1:00 ¹°¹æ¿ï.bmp
(notice the difference in shortname and longname)
WIN95_1 BMP 240 96-10-30 1:00 WIN95_1.bmp
(correct name of this file is WIN95 ¼³Ä¡ È­¸é.bmp)

  with patch applied scandisk doesn't complain anymore.

3. Feedback

  I welcome feedback from anyone interested, especially those from other
  DBCS country. If you have comments, feedback please mail me.



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



This archive was generated by hypermail 2b29 : Wed Oct 31 2001 - 21:00:25 EST