Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1363236 > unrolled thread

Re: [PATCHv2] fat: add config option to set UTF-8 mount option by default

Started byGeert Uytterhoeven <geert@linux-m68k.org>
First post2016-03-23 09:20 +0100
Last post2016-03-23 17:50 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCHv2] fat: add config option to set UTF-8 mount option by default Geert Uytterhoeven <geert@linux-m68k.org> - 2016-03-23 09:20 +0100
    Re: [PATCHv2] fat: add config option to set UTF-8 mount option by default Josh Boyer <jwboyer@fedoraproject.org> - 2016-03-23 12:30 +0100
      Re: [PATCHv2] fat: add config option to set UTF-8 mount option by default Geert Uytterhoeven <geert@linux-m68k.org> - 2016-03-23 13:30 +0100
        Re: [PATCHv2] fat: add config option to set UTF-8 mount option by default Josh Boyer <jwboyer@fedoraproject.org> - 2016-03-23 14:00 +0100
          Re: [PATCHv2] fat: add config option to set UTF-8 mount option by  default "Maciej S. Szmigiero" <mail@maciej.szmigiero.name> - 2016-03-23 17:50 +0100

#1363236 — Re: [PATCHv2] fat: add config option to set UTF-8 mount option by default

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-03-23 09:20 +0100
SubjectRe: [PATCHv2] fat: add config option to set UTF-8 mount option by default
Message-ID<rfMbg-CU-5@gated-at.bofh.it>
On Tue, Mar 8, 2016 at 2:53 PM, Maciej S. Szmigiero
<mail@maciej.szmigiero.name> wrote:
> FAT has long supported its own default file name encoding
> config setting, separate from CONFIG_NLS_DEFAULT.
>
> However, if UTF-8 encoded file names are desired FAT
> character set should not be set to utf8 since this would
> make file names case sensitive even if case insensitive
> matching is requested.
> Instead, "utf8" mount options should be provided to enable
> UTF-8 file names in FAT file system.
>
> Unfortunately, there was no possibility to set the default
> value of this option so on UTF-8 system "utf8" mount option
> had to be added manually to most FAT mounts.
>
> This patch adds config option to set such default value.
>
> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>

> --- a/fs/fat/Kconfig
> +++ b/fs/fat/Kconfig
> @@ -93,8 +93,24 @@ config FAT_DEFAULT_IOCHARSET
>           that most of your FAT filesystems use, and can be overridden
>           with the "iocharset" mount option for FAT filesystems.
>           Note that "utf8" is not recommended for FAT filesystems.
> -         If unsure, you shouldn't set "utf8" here.
> +         If unsure, you shouldn't set "utf8" here - select the next option
> +         instead if you would like to use UTF-8 encoded file names by default.
>           See <file:Documentation/filesystems/vfat.txt> for more information.
>
>           Enable any character sets you need in File Systems/Native Language
>           Support.
> +
> +config FAT_DEFAULT_UTF8
> +       bool "Enable FAT UTF-8 option by default"
> +       depends on VFAT_FS
> +       default n
> +       help
> +         Set this if you would like to have "utf8" mount option set
> +         by default when mounting FAT filesystems.
> +
> +         Even if you say Y here can always disable UTF-8 for
> +         particular mount by adding "utf8=0" to mount options.
> +
> +         Say Y if you use UTF-8 encoding for file names, N otherwise.
> +
> +         See <file:Documentation/filesystems/vfat.txt> for more information.

What's the recommended value of CONFIG_FAT_DEFAULT_UTF8 for
a (distro) defconfig?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

[toc] | [next] | [standalone]


#1363354

FromJosh Boyer <jwboyer@fedoraproject.org>
Date2016-03-23 12:30 +0100
Message-ID<rfP98-2DP-17@gated-at.bofh.it>
In reply to#1363236
On Wed, Mar 23, 2016 at 4:17 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Tue, Mar 8, 2016 at 2:53 PM, Maciej S. Szmigiero
> <mail@maciej.szmigiero.name> wrote:
>> FAT has long supported its own default file name encoding
>> config setting, separate from CONFIG_NLS_DEFAULT.
>>
>> However, if UTF-8 encoded file names are desired FAT
>> character set should not be set to utf8 since this would
>> make file names case sensitive even if case insensitive
>> matching is requested.
>> Instead, "utf8" mount options should be provided to enable
>> UTF-8 file names in FAT file system.
>>
>> Unfortunately, there was no possibility to set the default
>> value of this option so on UTF-8 system "utf8" mount option
>> had to be added manually to most FAT mounts.
>>
>> This patch adds config option to set such default value.
>>
>> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
>
>> --- a/fs/fat/Kconfig
>> +++ b/fs/fat/Kconfig
>> @@ -93,8 +93,24 @@ config FAT_DEFAULT_IOCHARSET
>>           that most of your FAT filesystems use, and can be overridden
>>           with the "iocharset" mount option for FAT filesystems.
>>           Note that "utf8" is not recommended for FAT filesystems.
>> -         If unsure, you shouldn't set "utf8" here.
>> +         If unsure, you shouldn't set "utf8" here - select the next option
>> +         instead if you would like to use UTF-8 encoded file names by default.
>>           See <file:Documentation/filesystems/vfat.txt> for more information.
>>
>>           Enable any character sets you need in File Systems/Native Language
>>           Support.
>> +
>> +config FAT_DEFAULT_UTF8
>> +       bool "Enable FAT UTF-8 option by default"
>> +       depends on VFAT_FS
>> +       default n
>> +       help
>> +         Set this if you would like to have "utf8" mount option set
>> +         by default when mounting FAT filesystems.
>> +
>> +         Even if you say Y here can always disable UTF-8 for
>> +         particular mount by adding "utf8=0" to mount options.
>> +
>> +         Say Y if you use UTF-8 encoding for file names, N otherwise.
>> +
>> +         See <file:Documentation/filesystems/vfat.txt> for more information.
>
> What's the recommended value of CONFIG_FAT_DEFAULT_UTF8 for
> a (distro) defconfig?

Yes, I'm curious about this as well.  My initial assumption is to
leave it off, given that if you turn it on when it wasn't previously
it will change the behavior.  I would also assume that is why it is
marked as default n.

josh

[toc] | [prev] | [next] | [standalone]


#1363395

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-03-23 13:30 +0100
Message-ID<rfQ5d-3jc-27@gated-at.bofh.it>
In reply to#1363354
On Wed, Mar 23, 2016 at 12:28 PM, Josh Boyer <jwboyer@fedoraproject.org> wrote:
> On Wed, Mar 23, 2016 at 4:17 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
>> On Tue, Mar 8, 2016 at 2:53 PM, Maciej S. Szmigiero
>> <mail@maciej.szmigiero.name> wrote:
>>> FAT has long supported its own default file name encoding
>>> config setting, separate from CONFIG_NLS_DEFAULT.
>>>
>>> However, if UTF-8 encoded file names are desired FAT
>>> character set should not be set to utf8 since this would
>>> make file names case sensitive even if case insensitive
>>> matching is requested.
>>> Instead, "utf8" mount options should be provided to enable
>>> UTF-8 file names in FAT file system.
>>>
>>> Unfortunately, there was no possibility to set the default
>>> value of this option so on UTF-8 system "utf8" mount option
>>> had to be added manually to most FAT mounts.
>>>
>>> This patch adds config option to set such default value.
>>>
>>> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
>>
>>> --- a/fs/fat/Kconfig
>>> +++ b/fs/fat/Kconfig
>>> @@ -93,8 +93,24 @@ config FAT_DEFAULT_IOCHARSET
>>>           that most of your FAT filesystems use, and can be overridden
>>>           with the "iocharset" mount option for FAT filesystems.
>>>           Note that "utf8" is not recommended for FAT filesystems.
>>> -         If unsure, you shouldn't set "utf8" here.
>>> +         If unsure, you shouldn't set "utf8" here - select the next option
>>> +         instead if you would like to use UTF-8 encoded file names by default.
>>>           See <file:Documentation/filesystems/vfat.txt> for more information.
>>>
>>>           Enable any character sets you need in File Systems/Native Language
>>>           Support.
>>> +
>>> +config FAT_DEFAULT_UTF8
>>> +       bool "Enable FAT UTF-8 option by default"
>>> +       depends on VFAT_FS
>>> +       default n
>>> +       help
>>> +         Set this if you would like to have "utf8" mount option set
>>> +         by default when mounting FAT filesystems.
>>> +
>>> +         Even if you say Y here can always disable UTF-8 for
>>> +         particular mount by adding "utf8=0" to mount options.
>>> +
>>> +         Say Y if you use UTF-8 encoding for file names, N otherwise.
>>> +
>>> +         See <file:Documentation/filesystems/vfat.txt> for more information.
>>
>> What's the recommended value of CONFIG_FAT_DEFAULT_UTF8 for
>> a (distro) defconfig?
>
> Yes, I'm curious about this as well.  My initial assumption is to
> leave it off, given that if you turn it on when it wasn't previously
> it will change the behavior.  I would also assume that is why it is
> marked as default n.

"default n" is superfluous, as all options default to "n" in the absence
of a default specifier.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

[toc] | [prev] | [next] | [standalone]


#1363414

FromJosh Boyer <jwboyer@fedoraproject.org>
Date2016-03-23 14:00 +0100
Message-ID<rfQyf-3tm-31@gated-at.bofh.it>
In reply to#1363395
On Wed, Mar 23, 2016 at 8:27 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Wed, Mar 23, 2016 at 12:28 PM, Josh Boyer <jwboyer@fedoraproject.org> wrote:
>> On Wed, Mar 23, 2016 at 4:17 AM, Geert Uytterhoeven
>> <geert@linux-m68k.org> wrote:
>>> On Tue, Mar 8, 2016 at 2:53 PM, Maciej S. Szmigiero
>>> <mail@maciej.szmigiero.name> wrote:
>>>> FAT has long supported its own default file name encoding
>>>> config setting, separate from CONFIG_NLS_DEFAULT.
>>>>
>>>> However, if UTF-8 encoded file names are desired FAT
>>>> character set should not be set to utf8 since this would
>>>> make file names case sensitive even if case insensitive
>>>> matching is requested.
>>>> Instead, "utf8" mount options should be provided to enable
>>>> UTF-8 file names in FAT file system.
>>>>
>>>> Unfortunately, there was no possibility to set the default
>>>> value of this option so on UTF-8 system "utf8" mount option
>>>> had to be added manually to most FAT mounts.
>>>>
>>>> This patch adds config option to set such default value.
>>>>
>>>> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
>>>
>>>> --- a/fs/fat/Kconfig
>>>> +++ b/fs/fat/Kconfig
>>>> @@ -93,8 +93,24 @@ config FAT_DEFAULT_IOCHARSET
>>>>           that most of your FAT filesystems use, and can be overridden
>>>>           with the "iocharset" mount option for FAT filesystems.
>>>>           Note that "utf8" is not recommended for FAT filesystems.
>>>> -         If unsure, you shouldn't set "utf8" here.
>>>> +         If unsure, you shouldn't set "utf8" here - select the next option
>>>> +         instead if you would like to use UTF-8 encoded file names by default.
>>>>           See <file:Documentation/filesystems/vfat.txt> for more information.
>>>>
>>>>           Enable any character sets you need in File Systems/Native Language
>>>>           Support.
>>>> +
>>>> +config FAT_DEFAULT_UTF8
>>>> +       bool "Enable FAT UTF-8 option by default"
>>>> +       depends on VFAT_FS
>>>> +       default n
>>>> +       help
>>>> +         Set this if you would like to have "utf8" mount option set
>>>> +         by default when mounting FAT filesystems.
>>>> +
>>>> +         Even if you say Y here can always disable UTF-8 for
>>>> +         particular mount by adding "utf8=0" to mount options.
>>>> +
>>>> +         Say Y if you use UTF-8 encoding for file names, N otherwise.
>>>> +
>>>> +         See <file:Documentation/filesystems/vfat.txt> for more information.
>>>
>>> What's the recommended value of CONFIG_FAT_DEFAULT_UTF8 for
>>> a (distro) defconfig?
>>
>> Yes, I'm curious about this as well.  My initial assumption is to
>> leave it off, given that if you turn it on when it wasn't previously
>> it will change the behavior.  I would also assume that is why it is
>> marked as default n.
>
> "default n" is superfluous, as all options default to "n" in the absence
> of a default specifier.

Yes, I know that.  I meant that I assumed the patch author knows that
too, and included it anyway as a helpful indicator that it shouldn't
be turned on in most cases.  At any rate, your question still stands
and it would be nice to get an answer.

josh

[toc] | [prev] | [next] | [standalone]


#1363551 — Re: [PATCHv2] fat: add config option to set UTF-8 mount option by default

From"Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
Date2016-03-23 17:50 +0100
SubjectRe: [PATCHv2] fat: add config option to set UTF-8 mount option by default
Message-ID<rfU8P-6dp-41@gated-at.bofh.it>
In reply to#1363414
On 23.03.2016 13:57, Josh Boyer wrote:
> On Wed, Mar 23, 2016 at 8:27 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
>> On Wed, Mar 23, 2016 at 12:28 PM, Josh Boyer <jwboyer@fedoraproject.org> wrote:
>>> On Wed, Mar 23, 2016 at 4:17 AM, Geert Uytterhoeven
>>> <geert@linux-m68k.org> wrote:
>>>> On Tue, Mar 8, 2016 at 2:53 PM, Maciej S. Szmigiero
>>>> <mail@maciej.szmigiero.name> wrote:
>>>>> FAT has long supported its own default file name encoding
>>>>> config setting, separate from CONFIG_NLS_DEFAULT.
>>>>>
>>>>> However, if UTF-8 encoded file names are desired FAT
>>>>> character set should not be set to utf8 since this would
>>>>> make file names case sensitive even if case insensitive
>>>>> matching is requested.
>>>>> Instead, "utf8" mount options should be provided to enable
>>>>> UTF-8 file names in FAT file system.
>>>>>
>>>>> Unfortunately, there was no possibility to set the default
>>>>> value of this option so on UTF-8 system "utf8" mount option
>>>>> had to be added manually to most FAT mounts.
>>>>>
>>>>> This patch adds config option to set such default value.
>>>>>
>>>>> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
>>>>
>>>>> --- a/fs/fat/Kconfig
>>>>> +++ b/fs/fat/Kconfig
>>>>> @@ -93,8 +93,24 @@ config FAT_DEFAULT_IOCHARSET
>>>>>           that most of your FAT filesystems use, and can be overridden
>>>>>           with the "iocharset" mount option for FAT filesystems.
>>>>>           Note that "utf8" is not recommended for FAT filesystems.
>>>>> -         If unsure, you shouldn't set "utf8" here.
>>>>> +         If unsure, you shouldn't set "utf8" here - select the next option
>>>>> +         instead if you would like to use UTF-8 encoded file names by default.
>>>>>           See <file:Documentation/filesystems/vfat.txt> for more information.
>>>>>
>>>>>           Enable any character sets you need in File Systems/Native Language
>>>>>           Support.
>>>>> +
>>>>> +config FAT_DEFAULT_UTF8
>>>>> +       bool "Enable FAT UTF-8 option by default"
>>>>> +       depends on VFAT_FS
>>>>> +       default n
>>>>> +       help
>>>>> +         Set this if you would like to have "utf8" mount option set
>>>>> +         by default when mounting FAT filesystems.
>>>>> +
>>>>> +         Even if you say Y here can always disable UTF-8 for
>>>>> +         particular mount by adding "utf8=0" to mount options.
>>>>> +
>>>>> +         Say Y if you use UTF-8 encoding for file names, N otherwise.
>>>>> +
>>>>> +         See <file:Documentation/filesystems/vfat.txt> for more information.
>>>>
>>>> What's the recommended value of CONFIG_FAT_DEFAULT_UTF8 for
>>>> a (distro) defconfig?
>>>
>>> Yes, I'm curious about this as well.  My initial assumption is to
>>> leave it off, given that if you turn it on when it wasn't previously
>>> it will change the behavior.  I would also assume that is why it is
>>> marked as default n.
>>
>> "default n" is superfluous, as all options default to "n" in the absence
>> of a default specifier.
> 
> Yes, I know that.  I meant that I assumed the patch author knows that
> too, and included it anyway as a helpful indicator that it shouldn't
> be turned on in most cases.  At any rate, your question still stands
> and it would be nice to get an answer.

The default is 'n' here for compatibility with older .configs,
and to be consistent with the main FS NLS option (CONFIG_NLS_DEFAULT)
since it also defaults to non-UTF-8 encoding.

If file names are UTF-8 encoded then if FAT filesystems were always
mounted with utf8 mount option, or with CONFIG_FAT_DEFAULT_IOCHARSET or
"iocharset" mount option set to "utf8" (not recommended,
but I've seen for example Knoppix doing it) then with this options set
there is effectively no change in functionality.

If file names are UTF-8 encoded but none of conditions described in
the previous paragraph were true then UTF-8 file names were reinterpreted
as CONFIG_FAT_DEFAULT_IOCHARSET (by default iso8859-1) then converted
into UTF-16 for storage.

While this usually worked it weren't correct: file names containing
characters outside ASCII had them replaced with some garbage when
accessing such FS with UTF-8 correctly enabled (for example with this
option set) or on Windows.

However, if such conditions (UTF-8 file names but non-UTF-8 FAT mount
options) were present for a long time then it has to be taken into
consideration that there are likely at least a few file systems with
file names encoded in such way and it would be good not to change it
suddenly when people update their kernels.

> josh

Maciej

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web