diff options
author | Sage Weil <sage@newdream.net> | 2009-10-27 13:19:28 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2009-10-27 14:17:25 -0400 |
commit | e53c2fe075feda1fd4f009956ac026dc24c3a199 (patch) | |
tree | 8607bbfb40f6eb1bd9d463b970454faa9623cd0e /fs/ceph/super.c | |
parent | 6ca874e92d5e50beb8e351dfd8121947bafc79ec (diff) |
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: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/super.c')
-rw-r--r-- | fs/ceph/super.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 924e6cad0b66..b094f5003ef8 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c | |||
@@ -264,9 +264,11 @@ enum { | |||
264 | Opt_caps_wanted_delay_min, | 264 | Opt_caps_wanted_delay_min, |
265 | Opt_caps_wanted_delay_max, | 265 | Opt_caps_wanted_delay_max, |
266 | Opt_readdir_max_entries, | 266 | Opt_readdir_max_entries, |
267 | Opt_last_int, | ||
267 | /* int args above */ | 268 | /* int args above */ |
268 | Opt_snapdirname, | 269 | Opt_snapdirname, |
269 | Opt_secret, | 270 | Opt_secret, |
271 | Opt_last_string, | ||
270 | /* string args above */ | 272 | /* string args above */ |
271 | Opt_ip, | 273 | Opt_ip, |
272 | Opt_noshare, | 274 | Opt_noshare, |
@@ -386,14 +388,19 @@ static int parse_mount_args(struct ceph_client *client, | |||
386 | pr_err("bad mount option at '%s'\n", c); | 388 | pr_err("bad mount option at '%s'\n", c); |
387 | goto out; | 389 | goto out; |
388 | } | 390 | } |
389 | if (token < Opt_ip) { | 391 | if (token < Opt_last_int) { |
390 | ret = match_int(&argstr[0], &intval); | 392 | ret = match_int(&argstr[0], &intval); |
391 | if (ret < 0) { | 393 | if (ret < 0) { |
392 | pr_err("bad mount option arg (not int) " | 394 | pr_err("bad mount option arg (not int) " |
393 | "at '%s'\n", c); | 395 | "at '%s'\n", c); |
394 | continue; | 396 | continue; |
395 | } | 397 | } |
396 | dout("got token %d intval %d\n", token, intval); | 398 | dout("got int token %d val %d\n", token, intval); |
399 | } else if (token > Opt_last_int && token < Opt_last_string) { | ||
400 | dout("got string token %d val %s\n", token, | ||
401 | argstr[0].from); | ||
402 | } else { | ||
403 | dout("got token %d\n", token); | ||
397 | } | 404 | } |
398 | switch (token) { | 405 | switch (token) { |
399 | case Opt_fsidmajor: | 406 | case Opt_fsidmajor: |