All of lore.kernel.org
 help / color / mirror / Atom feed
* [V9fs-developer][PATCH v2 1/2] net/9p: detecting invalid options as much as possible
@ 2018-04-17  6:45 Chengguang Xu
  2018-04-17  6:45 ` [V9fs-developer][PATCH v2 2/2] fs/9p: " Chengguang Xu
  2018-05-02 22:32 ` [V9fs-developer] [PATCH v2 1/2] net/9p: " Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Chengguang Xu @ 2018-04-17  6:45 UTC (permalink / raw)
  To: ericvh, rminnich, lucho; +Cc: v9fs-developer, linux-kernel, Chengguang Xu

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 'trans' and 'version'
when detecting EINVAL.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
Changes since v1:
- Do not change behavior when detecting ENOMEM or unrecognized options.

 net/9p/client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/9p/client.c b/net/9p/client.c
index 21e6df1..38b02fb 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -199,7 +199,7 @@ static int parse_opts(char *opts, struct p9_client *clnt)
 					s);
 				ret = -EINVAL;
 				kfree(s);
-				goto free_and_return;
+				continue;
 			}
 			kfree(s);
 			break;
@@ -217,7 +217,7 @@ static int parse_opts(char *opts, struct p9_client *clnt)
 			ret = get_protocol_version(s);
 			if (ret == -EINVAL) {
 				kfree(s);
-				goto free_and_return;
+				continue;
 			}
 			kfree(s);
 			clnt->proto_version = ret;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-03  6:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17  6:45 [V9fs-developer][PATCH v2 1/2] net/9p: detecting invalid options as much as possible Chengguang Xu
2018-04-17  6:45 ` [V9fs-developer][PATCH v2 2/2] fs/9p: " Chengguang Xu
2018-05-02 22:32 ` [V9fs-developer] [PATCH v2 1/2] net/9p: " Andrew Morton
2018-05-03  6:14   ` cgxu519

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.