* [PATCH] NFS: correctly report misuse of "migration" mount option.
@ 2013-11-14 2:00 NeilBrown
2013-11-14 16:31 ` Chuck Lever
0 siblings, 1 reply; 2+ messages in thread
From: NeilBrown @ 2013-11-14 2:00 UTC (permalink / raw)
To: Charles Edward Lever, Myklebust, Trond, NFS
[-- Attachment #1: Type: text/plain, Size: 945 bytes --]
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>
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 317d6fc2160e..910ed906eb82 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1613,9 +1613,9 @@ static int nfs_parse_mount_options(char *raw,
if (mnt->minorversion && mnt->version != 4)
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;
/*
* verify that any proto=/mountproto= options match the address
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] NFS: correctly report misuse of "migration" mount option.
2013-11-14 2:00 [PATCH] NFS: correctly report misuse of "migration" mount option NeilBrown
@ 2013-11-14 16:31 ` Chuck Lever
0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2013-11-14 16:31 UTC (permalink / raw)
To: NeilBrown; +Cc: Myklebust, Trond, NFS
On Nov 13, 2013, at 9:00 PM, NeilBrown <neilb@suse.de> wrote:
>
> 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>
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 317d6fc2160e..910ed906eb82 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -1613,9 +1613,9 @@ static int nfs_parse_mount_options(char *raw,
> if (mnt->minorversion && mnt->version != 4)
> 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;
>
> /*
> * verify that any proto=/mountproto= options match the address
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-14 16:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 2:00 [PATCH] NFS: correctly report misuse of "migration" mount option NeilBrown
2013-11-14 16:31 ` Chuck Lever
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).