NFS: Fix up new minorversion= option
The new minorversion= mount option (commit3fd5be9e
) was merged at the same time as the recent sloppy parser fixes (commita5a16bae
), 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>
This commit is contained in:
committed by
Trond Myklebust
parent
7b2aa037e8
commit
f3f4f4ed26
@@ -158,7 +158,7 @@ static const match_table_t nfs_mount_option_tokens = {
|
|||||||
{ Opt_mountvers, "mountvers=%s" },
|
{ Opt_mountvers, "mountvers=%s" },
|
||||||
{ Opt_nfsvers, "nfsvers=%s" },
|
{ Opt_nfsvers, "nfsvers=%s" },
|
||||||
{ Opt_nfsvers, "vers=%s" },
|
{ Opt_nfsvers, "vers=%s" },
|
||||||
{ Opt_minorversion, "minorversion=%u" },
|
{ Opt_minorversion, "minorversion=%s" },
|
||||||
|
|
||||||
{ Opt_sec, "sec=%s" },
|
{ Opt_sec, "sec=%s" },
|
||||||
{ Opt_proto, "proto=%s" },
|
{ Opt_proto, "proto=%s" },
|
||||||
@@ -1001,7 +1001,6 @@ static int nfs_parse_mount_options(char *raw,
|
|||||||
while ((p = strsep(&raw, ",")) != NULL) {
|
while ((p = strsep(&raw, ",")) != NULL) {
|
||||||
substring_t args[MAX_OPT_ARGS];
|
substring_t args[MAX_OPT_ARGS];
|
||||||
unsigned long option;
|
unsigned long option;
|
||||||
int int_option;
|
|
||||||
int token;
|
int token;
|
||||||
|
|
||||||
if (!*p)
|
if (!*p)
|
||||||
@@ -1273,11 +1272,16 @@ static int nfs_parse_mount_options(char *raw,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Opt_minorversion:
|
case Opt_minorversion:
|
||||||
if (match_int(args, &int_option))
|
string = match_strdup(args);
|
||||||
return 0;
|
if (string == NULL)
|
||||||
if (int_option < 0 || int_option > NFS4_MAX_MINOR_VERSION)
|
goto out_nomem;
|
||||||
return 0;
|
rc = strict_strtoul(string, 10, &option);
|
||||||
mnt->minorversion = int_option;
|
kfree(string);
|
||||||
|
if (rc != 0)
|
||||||
|
goto out_invalid_value;
|
||||||
|
if (option > NFS4_MAX_MINOR_VERSION)
|
||||||
|
goto out_invalid_value;
|
||||||
|
mnt->minorversion = option;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user