ceph: don't crash when passed bad mount options
authorYehuda Sadeh <yehuda@hq.newdream.net>
Thu, 30 Sep 2010 18:58:31 +0000 (11:58 -0700)
committerSage Weil <sage@newdream.net>
Wed, 20 Oct 2010 22:38:22 +0000 (15:38 -0700)
This only happened when parse_extra_token was not passed
to ceph_parse_option() (hence, only happened in rbd).

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
net/ceph/ceph_common.c

index f6f2eeb..f3e4a13 100644 (file)
@@ -249,7 +249,7 @@ int ceph_parse_options(struct ceph_options **popt, char *options,
                        continue;
                err = -EINVAL;
                token = match_token((char *)c, opt_tokens, argstr);
-               if (token < 0) {
+               if (token < 0 && parse_extra_token) {
                        /* extra? */
                        err = parse_extra_token((char *)c, private);
                        if (err < 0) {