diff options
author | Weston Andros Adamson <dros@netapp.com> | 2012-02-01 14:06:41 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-02-15 00:19:52 -0500 |
commit | 571b7554016941ef0f0c3c61be72561e2bc55f5e (patch) | |
tree | a8ad7cc44feb613af22775211d377606c737b575 | |
parent | 2f09c24216cd789653eb8efbf8be88409eb8d581 (diff) | |
download | op-kernel-dev-571b7554016941ef0f0c3c61be72561e2bc55f5e.zip op-kernel-dev-571b7554016941ef0f0c3c61be72561e2bc55f5e.tar.gz |
NFS: dont allow minorversion= opt when vers != 4
Don't allow invalid 'vers' and 'minorversion' combinations in mount options,
such as "vers=3,minorversion=1".
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/super.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index d18a90b..d05024a 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1531,6 +1531,9 @@ static int nfs_parse_mount_options(char *raw, if (!sloppy && invalid_option) return 0; + if (mnt->minorversion && mnt->version != 4) + goto out_minorversion_mismatch; + /* * verify that any proto=/mountproto= options match the address * familiies in the addr=/mountaddr= options. @@ -1564,6 +1567,10 @@ out_invalid_address: out_invalid_value: printk(KERN_INFO "NFS: bad mount option value specified: %s\n", p); return 0; +out_minorversion_mismatch: + printk(KERN_INFO "NFS: mount option vers=%u does not support " + "minorversion=%u\n", mnt->version, mnt->minorversion); + return 0; out_nomem: printk(KERN_INFO "NFS: not enough memory to parse option\n"); return 0; |