]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
NFS: dont allow minorversion= opt when vers != 4
authorWeston Andros Adamson <dros@netapp.com>
Wed, 1 Feb 2012 19:06:41 +0000 (14:06 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 15 Feb 2012 05:19:52 +0000 (00:19 -0500)
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>
fs/nfs/super.c

index d18a90ba165fe7d1b43ac2b349f5a74467c54bb8..d05024a1898467eca2c797e1262571031d0882bf 100644 (file)
@@ -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;