lkml.org 
[lkml]   [2018]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[V9fs-developer][PATCH v2 2/2] fs/9p: detecting invalid options as much as possible
Date
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@gmx.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
\
 
 \ /
  Last update: 2018-04-17 08:47    [W:0.042 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site