Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e53c2fe0 authored by Sage Weil's avatar Sage Weil
Browse files

ceph: fix, clean up string mount arg parsing



Clearly demark int and string argument options, and do not try to convert
string arguments to ints.

Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 6ca874e9
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -264,9 +264,11 @@ enum {
	Opt_caps_wanted_delay_min,
	Opt_caps_wanted_delay_min,
	Opt_caps_wanted_delay_max,
	Opt_caps_wanted_delay_max,
	Opt_readdir_max_entries,
	Opt_readdir_max_entries,
	Opt_last_int,
	/* int args above */
	/* int args above */
	Opt_snapdirname,
	Opt_snapdirname,
	Opt_secret,
	Opt_secret,
	Opt_last_string,
	/* string args above */
	/* string args above */
	Opt_ip,
	Opt_ip,
	Opt_noshare,
	Opt_noshare,
@@ -386,14 +388,19 @@ static int parse_mount_args(struct ceph_client *client,
			pr_err("bad mount option at '%s'\n", c);
			pr_err("bad mount option at '%s'\n", c);
			goto out;
			goto out;
		}
		}
		if (token < Opt_ip) {
		if (token < Opt_last_int) {
			ret = match_int(&argstr[0], &intval);
			ret = match_int(&argstr[0], &intval);
			if (ret < 0) {
			if (ret < 0) {
				pr_err("bad mount option arg (not int) "
				pr_err("bad mount option arg (not int) "
				       "at '%s'\n", c);
				       "at '%s'\n", c);
				continue;
				continue;
			}
			}
			dout("got token %d intval %d\n", token, intval);
			dout("got int token %d val %d\n", token, intval);
		} else if (token > Opt_last_int && token < Opt_last_string) {
			dout("got string token %d val %s\n", token,
			     argstr[0].from);
		} else {
			dout("got token %d\n", token);
		}
		}
		switch (token) {
		switch (token) {
		case Opt_fsidmajor:
		case Opt_fsidmajor: