From 0e156c15e31ac4f3e160a6ac262b172d0390d7e8 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 26 Aug 2016 02:31:50 +0100 Subject: [PATCH] fat: Mitigate the lack of UTF-8 case folding FAT has to convert between Linux filenames ('iocharset' encoding, should be UTF-8 today) and native filenames (UTF-16 for long names, 'codepage' encoding for short names). And it has to do case folding in multiple encodings. Unfortunately Linux doesn't implement case-folding for UTF-8, resulting in inconsistent name lookup behaviour as shown in bug #833238. The 'utf8' option makes FAT assume the Linux filename encoding is UTF-8, regardless of the 'iocharset' encoding. Enabling this and setting iocharset=ascii mitigates the problems by enabling case- folding for the ASCII subset. Make that the default by enabling FAT_DEFAULT_UTF8 and setting FAT_DEFAULT_IOCHARSET to "ascii". --- debian/changelog | 3 +++ debian/config/config | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a1601f095..1ae7a4170 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,9 @@ linux (4.7.2-1) UNRELEASED; urgency=medium * aufs: Update support patches to aufs4.7-20160822 (Closes: #834764) * [powerpc*] ipmi: Enable IPMI_POWERNV as module (Closes: #833861) * kbuild: Do not use hyphen in exported variable name (Closes: #833561) + * fat: Mitigate the lack of UTF-8 case folding by enabling + FAT_DEFAULT_UTF8 and setting FAT_DEFAULT_IOCHARSET to "ascii" + (Closes: #833238) [ Martin Michlmayr ] * [armhf] Enable MMC_SDHCI_IPROC and HW_RANDOM_BCM2835 for BCM2835. diff --git a/debian/config/config b/debian/config/config index fb79160b0..1d46ebd64 100644 --- a/debian/config/config +++ b/debian/config/config @@ -5106,7 +5106,11 @@ CONFIG_F2FS_FS_ENCRYPTION=y CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="utf8" +#. Mitigate the lack of UTF-8 case-folding which makes FAT name lookup +#. inconsistent (#833238). This combination enables case-folding the +#. ASCII subset while still encoding/decoding as UTF-8. +CONFIG_FAT_DEFAULT_IOCHARSET="ascii" +CONFIG_FAT_DEFAULT_UTF8=y ## ## file: fs/freevxfs/Kconfig