[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1523947502-6103-2-git-send-email-cgxu519@gmx.com>
Date: Tue, 17 Apr 2018 14:45:02 +0800
From: Chengguang Xu <cgxu519@....com>
To: ericvh@...il.com, rminnich@...dia.gov, lucho@...kov.net
Cc: v9fs-developer@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
Chengguang Xu <cgxu519@....com>
Subject: [V9fs-developer][PATCH v2 2/2] fs/9p: detecting invalid options as much as possible
Currently when detecting invalid options in option parsing,
some options(e.g. msize) just set errno and allow to continuously
validate other options so that it can detect invalid options
as much as possible and give proper error messages together.
This patch applies same rule to option 'cache' and 'access'
when detecting EINVAL.
Signed-off-by: Chengguang Xu <cgxu519@....com>
---
Changes since v1:
- Do not change behavior when detecting ENOMEM or unrecognized options.
fs/9p/v9fs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c
index e622f0f..2c7a0ef 100644
--- a/fs/9p/v9fs.c
+++ b/fs/9p/v9fs.c
@@ -309,7 +309,7 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
ret = get_cache_mode(s);
if (ret == -EINVAL) {
kfree(s);
- goto free_and_return;
+ continue;
}
v9ses->cache = ret;
@@ -341,14 +341,14 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
pr_info("Unknown access argument %s\n",
s);
kfree(s);
- goto free_and_return;
+ continue;
}
v9ses->uid = make_kuid(current_user_ns(), uid);
if (!uid_valid(v9ses->uid)) {
ret = -EINVAL;
pr_info("Uknown uid %s\n", s);
kfree(s);
- goto free_and_return;
+ continue;
}
}
--
1.8.3.1
Powered by blists - more mailing lists