linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: NeilBrown <neilb@suse.de>
Cc: "Myklebust, Trond" <Trond.Myklebust@netapp.com>,
	NFS <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] NFS: correctly report misuse of "migration" mount option.
Date: Thu, 14 Nov 2013 11:31:44 -0500	[thread overview]
Message-ID: <2AD44909-BC7D-437C-8F9A-F6B2103DDC9E@oracle.com> (raw)
In-Reply-To: <20131114130017.374c0f3d@notabene.brown>


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





      reply	other threads:[~2013-11-14 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14  2:00 [PATCH] NFS: correctly report misuse of "migration" mount option NeilBrown
2013-11-14 16:31 ` Chuck Lever [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2AD44909-BC7D-437C-8F9A-F6B2103DDC9E@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).