summaryrefslogtreecommitdiffstats
path: root/fs/isofs/joliet.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-08-08 18:24:37 +0200
committerJan Kara <jack@suse.cz>2021-08-12 16:07:14 +0200
commit28ce50f8d96ec9035f60c9348294ea26b94db944 (patch)
treeedd97edb8dea044d3474ad96773ea65a17cbd480 /fs/isofs/joliet.c
parentb645333443712d2613e4e863f81090d5dc509657 (diff)
downloadlinux-28ce50f8d96ec9035f60c9348294ea26b94db944.tar.gz
linux-28ce50f8d96ec9035f60c9348294ea26b94db944.tar.bz2
linux-28ce50f8d96ec9035f60c9348294ea26b94db944.zip
isofs: joliet: Fix iocharset=utf8 mount option
Currently iocharset=utf8 mount option is broken. To use UTF-8 as iocharset, it is required to use utf8 mount option. Fix iocharset=utf8 mount option to use be equivalent to the utf8 mount option. If UTF-8 as iocharset is used then s_nls_iocharset is set to NULL. So simplify code around, remove s_utf8 field as to distinguish between UTF-8 and non-UTF-8 it is needed just to check if s_nls_iocharset is set to NULL or not. Link: https://lore.kernel.org/r/20210808162453.1653-5-pali@kernel.org Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/isofs/joliet.c')
-rw-r--r--fs/isofs/joliet.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/isofs/joliet.c b/fs/isofs/joliet.c
index be8b6a9d0b92..c0f04a1e7f69 100644
--- a/fs/isofs/joliet.c
+++ b/fs/isofs/joliet.c
@@ -41,14 +41,12 @@ uni16_to_x8(unsigned char *ascii, __be16 *uni, int len, struct nls_table *nls)
int
get_joliet_filename(struct iso_directory_record * de, unsigned char *outname, struct inode * inode)
{
- unsigned char utf8;
struct nls_table *nls;
unsigned char len = 0;
- utf8 = ISOFS_SB(inode->i_sb)->s_utf8;
nls = ISOFS_SB(inode->i_sb)->s_nls_iocharset;
- if (utf8) {
+ if (!nls) {
len = utf16s_to_utf8s((const wchar_t *) de->name,
de->name_len[0] >> 1, UTF16_BIG_ENDIAN,
outname, PAGE_SIZE);