NFS: correctly report misuse of "migration" mount option.
authorNeilBrown <neilb@suse.de>
Thu, 14 Nov 2013 02:00:17 +0000 (13:00 +1100)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 15 Nov 2013 18:41:43 +0000 (13:41 -0500)
The current test on valid use of the "migration" mount option can never
report an error as it will only do so if
    mnt->version !=4 && mnt->minor_version != 0
(and some other condition), but if that test would succeed, then the previous
test has already gone-to  out_minorversion_mismatch.

So change the && to an || to get correct semantics.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/super.c

index 317d6fc2160ebe787714e0f0ac6cb5288b0527b7..910ed906eb82f0465eb9317f8c8d4c7640bc7e17 100644 (file)
@@ -1614,7 +1614,7 @@ static int nfs_parse_mount_options(char *raw,
                goto out_minorversion_mismatch;
 
        if (mnt->options & NFS_OPTION_MIGRATION &&
-           mnt->version != 4 && mnt->minorversion != 0)
+           (mnt->version != 4 || mnt->minorversion != 0))
                goto out_migration_misuse;
 
        /*