Message ID | 20221226142150.13324-4-pali@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fs: Remove usage of broken nls_utf8 and drop it | expand |
26.12.2022 klo 16.22 Pali Rohár (pali@kernel.org) wrote: > > Other fs drivers are using iocharset= mount option for specifying charset. > So mark iocharset= mount option as preferred and deprecate nls= mount > option. snip. > diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c snip. > @@ -218,10 +213,10 @@ static bool parse_options(ntfs_volume *vol, char *opt) > } else if (!strcmp(p, "utf8")) { > bool val = false; > ntfs_warning(vol->sb, "Option utf8 is no longer " > - "supported, using option nls=utf8. Please " > - "use option nls=utf8 in the future and " > - "make sure utf8 is compiled either as a " > - "module or into the kernel."); > + "supported, using option iocharset=utf8. " > + "Please use option iocharset=utf8 in the " > + "future and make sure utf8 is compiled " > + "either as a module or into the kernel."); We do not have to make sure utf8 is compiled anymore as it "always is" right? > if (!v || !*v) > val = true; > else if (!simple_getbool(v, &val))
On Sunday 01 January 2023 21:02:46 Kari Argillander wrote: > 26.12.2022 klo 16.22 Pali Rohár (pali@kernel.org) wrote: > > > > Other fs drivers are using iocharset= mount option for specifying charset. > > So mark iocharset= mount option as preferred and deprecate nls= mount > > option. > > snip. > > > diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c > > snip. > > > @@ -218,10 +213,10 @@ static bool parse_options(ntfs_volume *vol, char *opt) > > } else if (!strcmp(p, "utf8")) { > > bool val = false; > > ntfs_warning(vol->sb, "Option utf8 is no longer " > > - "supported, using option nls=utf8. Please " > > - "use option nls=utf8 in the future and " > > - "make sure utf8 is compiled either as a " > > - "module or into the kernel."); > > + "supported, using option iocharset=utf8. " > > + "Please use option iocharset=utf8 in the " > > + "future and make sure utf8 is compiled " > > + "either as a module or into the kernel."); > > We do not have to make sure utf8 is compiled anymore as it "always is" right? Yes, right, we have always utf8 support compiled-in. Second part of that warning message should be dropped. > > if (!v || !*v) > > val = true; > > else if (!simple_getbool(v, &val))
On Sunday 01 January 2023 20:06:05 Pali Rohár wrote: > On Sunday 01 January 2023 21:02:46 Kari Argillander wrote: > > 26.12.2022 klo 16.22 Pali Rohár (pali@kernel.org) wrote: > > > > > > Other fs drivers are using iocharset= mount option for specifying charset. > > > So mark iocharset= mount option as preferred and deprecate nls= mount > > > option. > > > > snip. > > > > > diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c > > > > snip. > > > > > @@ -218,10 +213,10 @@ static bool parse_options(ntfs_volume *vol, char *opt) > > > } else if (!strcmp(p, "utf8")) { > > > bool val = false; > > > ntfs_warning(vol->sb, "Option utf8 is no longer " > > > - "supported, using option nls=utf8. Please " > > > - "use option nls=utf8 in the future and " > > > - "make sure utf8 is compiled either as a " > > > - "module or into the kernel."); > > > + "supported, using option iocharset=utf8. " > > > + "Please use option iocharset=utf8 in the " > > > + "future and make sure utf8 is compiled " > > > + "either as a module or into the kernel."); > > > > We do not have to make sure utf8 is compiled anymore as it "always is" right? > > Yes, right, we have always utf8 support compiled-in. > Second part of that warning message should be dropped. Ok, this is truth after patch 15/18. So info about compiled module should be dropped in patch 15/18, not in this one. > > > if (!v || !*v) > > > val = true; > > > else if (!simple_getbool(v, &val))
diff --git a/Documentation/filesystems/ntfs.rst b/Documentation/filesystems/ntfs.rst index 5bb093a26485..51784141b56a 100644 --- a/Documentation/filesystems/ntfs.rst +++ b/Documentation/filesystems/ntfs.rst @@ -109,10 +109,9 @@ mount command (man 8 mount, also see man 5 fstab), the NTFS driver supports the following mount options: ======================= ======================================================= -iocharset=name Deprecated option. Still supported but please use - nls=name in the future. See description for nls=name. +nls=name Alias for ``iocharset=`` mount option. -nls=name Character set to use when returning file names. +iocharset=name Character set to use when returning file names. Unlike VFAT, NTFS suppresses names that contain unconvertible characters. Note that most character sets contain insufficient characters to represent all diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 08c659332e26..2ab071c4560d 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -2314,7 +2314,7 @@ int ntfs_show_options(struct seq_file *sf, struct dentry *root) seq_printf(sf, ",fmask=0%o", vol->fmask); seq_printf(sf, ",dmask=0%o", vol->dmask); } - seq_printf(sf, ",nls=%s", vol->nls_map->charset); + seq_printf(sf, ",iocharset=%s", vol->nls_map->charset); if (NVolCaseSensitive(vol)) seq_printf(sf, ",case_sensitive"); if (NVolShowSystemFiles(vol)) diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 001f4e053c85..55762abdc22a 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -192,11 +192,6 @@ static bool parse_options(ntfs_volume *vol, char *opt) ntfs_warning(vol->sb, "Ignoring obsolete option %s.", p); else if (!strcmp(p, "nls") || !strcmp(p, "iocharset")) { - if (!strcmp(p, "iocharset")) - ntfs_warning(vol->sb, "Option iocharset is " - "deprecated. Please use " - "option nls=<charsetname> in " - "the future."); if (!v || !*v) goto needs_arg; use_utf8: @@ -218,10 +213,10 @@ static bool parse_options(ntfs_volume *vol, char *opt) } else if (!strcmp(p, "utf8")) { bool val = false; ntfs_warning(vol->sb, "Option utf8 is no longer " - "supported, using option nls=utf8. Please " - "use option nls=utf8 in the future and " - "make sure utf8 is compiled either as a " - "module or into the kernel."); + "supported, using option iocharset=utf8. " + "Please use option iocharset=utf8 in the " + "future and make sure utf8 is compiled " + "either as a module or into the kernel."); if (!v || !*v) val = true; else if (!simple_getbool(v, &val)) diff --git a/fs/ntfs/unistr.c b/fs/ntfs/unistr.c index a6b6c64f14a9..75a7f73bccdd 100644 --- a/fs/ntfs/unistr.c +++ b/fs/ntfs/unistr.c @@ -372,7 +372,8 @@ retry: wc = nls->uni2char(le16_to_cpu(ins[i]), ns + o, conversion_err: ntfs_error(vol->sb, "Unicode name contains characters that cannot be " "converted to character set %s. You might want to " - "try to use the mount option nls=utf8.", nls->charset); + "try to use the mount option iocharset=utf8.", + nls->charset); if (ns != *outs) kfree(ns); if (wc != -ENAMETOOLONG)
Other fs drivers are using iocharset= mount option for specifying charset. So mark iocharset= mount option as preferred and deprecate nls= mount option. Signed-off-by: Pali Rohár <pali@kernel.org> --- Documentation/filesystems/ntfs.rst | 5 ++--- fs/ntfs/inode.c | 2 +- fs/ntfs/super.c | 13 ++++--------- fs/ntfs/unistr.c | 3 ++- 4 files changed, 9 insertions(+), 14 deletions(-)