[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221226142150.13324-5-pali@kernel.org>
Date: Mon, 26 Dec 2022 15:21:36 +0100
From: Pali Rohár <pali@...nel.org>
To: linux-fsdevel@...r.kernel.org,
linux-ntfs-dev@...ts.sourceforge.net, linux-cifs@...r.kernel.org,
jfs-discussion@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
Alexander Viro <viro@...iv.linux.org.uk>,
Jan Kara <jack@...e.cz>, "Theodore Y . Ts'o" <tytso@....edu>,
Anton Altaparmakov <anton@...era.com>,
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
Luis de Bethencourt <luisbg@...nel.org>,
Salah Triki <salah.triki@...il.com>,
Steve French <sfrench@...ba.org>, Paulo Alcantara <pc@....nz>,
Ronnie Sahlberg <lsahlber@...hat.com>,
Shyam Prasad N <sprasad@...rosoft.com>,
Tom Talpey <tom@...pey.com>, Dave Kleikamp <shaggy@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Pavel Machek <pavel@....cz>,
Christoph Hellwig <hch@...radead.org>,
Kari Argillander <kari.argillander@...il.com>,
Viacheslav Dubeyko <slava@...eyko.com>
Subject: [RFC PATCH v2 04/18] ntfs: Fix error processing when load_nls() fails
Ensure that specified charset in iocharset= mount option is used. On error
correctly propagate error code back to the caller.
Signed-off-by: Pali Rohár <pali@...nel.org>
---
fs/ntfs/super.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 55762abdc22a..b4f26035e750 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -94,7 +94,7 @@ static bool parse_options(ntfs_volume *vol, char *opt)
umode_t fmask = (umode_t)-1, dmask = (umode_t)-1;
int mft_zone_multiplier = -1, on_errors = -1;
int show_sys_files = -1, case_sensitive = -1, disable_sparse = -1;
- struct nls_table *nls_map = NULL, *old_nls;
+ struct nls_table *nls_map = NULL;
/* I am lazy... (-8 */
#define NTFS_GETOPT_WITH_DEFAULT(option, variable, default_value) \
@@ -195,20 +195,12 @@ static bool parse_options(ntfs_volume *vol, char *opt)
if (!v || !*v)
goto needs_arg;
use_utf8:
- old_nls = nls_map;
+ unload_nls(nls_map);
nls_map = load_nls(v);
if (!nls_map) {
- if (!old_nls) {
- ntfs_error(vol->sb, "NLS character set "
- "%s not found.", v);
- return false;
- }
- ntfs_error(vol->sb, "NLS character set %s not "
- "found. Using previous one %s.",
- v, old_nls->charset);
- nls_map = old_nls;
- } else /* nls_map */ {
- unload_nls(old_nls);
+ ntfs_error(vol->sb, "NLS character set "
+ "%s not found.", v);
+ return false;
}
} else if (!strcmp(p, "utf8")) {
bool val = false;
--
2.20.1
Powered by blists - more mailing lists