[V9fs-developer][PATCH v2 2/2] fs/9p: detecting invalid options as much as possible

From: Chengguang Xu
Date: Tue Apr 17 2018 - 02:46:34 EST


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@xxxxxxx>
---
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