aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-08-09 15:09:29 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2009-08-09 15:09:29 -0400
commitf3f4f4ed26b116f621596f74d42d2b736171e968 (patch)
tree3e709094beba4b302c9a6a08afa9a3e2f0b8d3b1 /fs/nfs
parent7b2aa037e878c939676675969983284a02958ae3 (diff)
NFS: Fix up new minorversion= option
The new minorversion= mount option (commit 3fd5be9e) was merged at the same time as the recent sloppy parser fixes (commit a5a16bae), so minorversion= still uses the old value parsing logic. If the minorversion= option specifies a bogus value, it should fail with "bad value" not "bad option." Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/super.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 0b4cbdc60abd..83a31070bc1a 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -158,7 +158,7 @@ static const match_table_t nfs_mount_option_tokens = {
158 { Opt_mountvers, "mountvers=%s" }, 158 { Opt_mountvers, "mountvers=%s" },
159 { Opt_nfsvers, "nfsvers=%s" }, 159 { Opt_nfsvers, "nfsvers=%s" },
160 { Opt_nfsvers, "vers=%s" }, 160 { Opt_nfsvers, "vers=%s" },
161 { Opt_minorversion, "minorversion=%u" }, 161 { Opt_minorversion, "minorversion=%s" },
162 162
163 { Opt_sec, "sec=%s" }, 163 { Opt_sec, "sec=%s" },
164 { Opt_proto, "proto=%s" }, 164 { Opt_proto, "proto=%s" },
@@ -1001,7 +1001,6 @@ static int nfs_parse_mount_options(char *raw,
1001 while ((p = strsep(&raw, ",")) != NULL) { 1001 while ((p = strsep(&raw, ",")) != NULL) {
1002 substring_t args[MAX_OPT_ARGS]; 1002 substring_t args[MAX_OPT_ARGS];
1003 unsigned long option; 1003 unsigned long option;
1004 int int_option;
1005 int token; 1004 int token;
1006 1005
1007 if (!*p) 1006 if (!*p)
@@ -1273,11 +1272,16 @@ static int nfs_parse_mount_options(char *raw,
1273 } 1272 }
1274 break; 1273 break;
1275 case Opt_minorversion: 1274 case Opt_minorversion:
1276 if (match_int(args, &int_option)) 1275 string = match_strdup(args);
1277 return 0; 1276 if (string == NULL)
1278 if (int_option < 0 || int_option > NFS4_MAX_MINOR_VERSION) 1277 goto out_nomem;
1279 return 0; 1278 rc = strict_strtoul(string, 10, &option);
1280 mnt->minorversion = int_option; 1279 kfree(string);
1280 if (rc != 0)
1281 goto out_invalid_value;
1282 if (option > NFS4_MAX_MINOR_VERSION)
1283 goto out_invalid_value;
1284 mnt->minorversion = option;
1281 break; 1285 break;
1282 1286
1283 /* 1287 /*