aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-06-27 09:05:08 -0400
committerIlya Dryomov <idryomov@gmail.com>2018-08-02 15:26:11 -0400
commit17173c82e3daa28742bf7732520e9bc2e0cb977d (patch)
tree06f1d1ec84aae800a65c6c7b9ce46680ee533560 /net/ceph
parentc9ed51c9123ab5e8f79b7d53a9afd786b43d4fe6 (diff)
libceph: stop parsing when a bad int arg is detected
There is no reason to continue option parsing after detecting bad option. [ Return match_int() errors from ceph_parse_options() to match the behaviour of parse_rbd_opts_token() and parse_fsopt_token(). ] Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph')
-rw-r--r--net/ceph/ceph_common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 584fdbef2088..1677a6132034 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -379,7 +379,7 @@ ceph_parse_options(char *options, const char *dev_name,
379 379
380 /* parse mount options */ 380 /* parse mount options */
381 while ((c = strsep(&options, ",")) != NULL) { 381 while ((c = strsep(&options, ",")) != NULL) {
382 int token, intval, ret; 382 int token, intval;
383 if (!*c) 383 if (!*c)
384 continue; 384 continue;
385 err = -EINVAL; 385 err = -EINVAL;
@@ -394,11 +394,11 @@ ceph_parse_options(char *options, const char *dev_name,
394 continue; 394 continue;
395 } 395 }
396 if (token < Opt_last_int) { 396 if (token < Opt_last_int) {
397 ret = match_int(&argstr[0], &intval); 397 err = match_int(&argstr[0], &intval);
398 if (ret < 0) { 398 if (err < 0) {
399 pr_err("bad mount option arg (not int) " 399 pr_err("bad mount option arg (not int) "
400 "at '%s'\n", c); 400 "at '%s'\n", c);
401 continue; 401 goto out;
402 } 402 }
403 dout("got int token %d val %d\n", token, intval); 403 dout("got int token %d val %d\n", token, intval);
404 } else if (token > Opt_last_int && token < Opt_last_string) { 404 } else if (token > Opt_last_int && token < Opt_last_string) {