linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Steve Dickson <steved@redhat.com>,
	Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] mount.nfs: v4 mounts should fail when -o flag is used.
Date: Mon, 22 May 2017 13:03:35 +1000	[thread overview]
Message-ID: <87inktk2yg.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20170519222510.31205-1-steved@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]

On Fri, May 19 2017, Steve Dickson wrote:

> When the pseudo root is set with fsid=0, explicit
> v4 mounts (via the -o flag) should fail when
> the incorrect export is tried instead of rolling
> back to v3.

Hi Steve,
 I think this patch makes sense, but the above description doesn't.
 Where does fsid=0 fit in anywhere here?

I think you want to say

  When the protocol is set with "-t nfs4", we should behave just like
  with do with "-o vers=4" and not fall back to v3.

Is that what you were really trying to say?

Thanks,
NeilBrown


>
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  utils/mount/network.c | 3 ++-
>  utils/mount/network.h | 8 ++++----
>  2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/utils/mount/network.c b/utils/mount/network.c
> index 281e935..e39263e 100644
> --- a/utils/mount/network.c
> +++ b/utils/mount/network.c
> @@ -1299,7 +1299,8 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)
>  		if (!(version->minor = strtol(version_val, &cptr, 10)) && cptr == version_val)
>  			goto ret_error;
>  		version->v_mode = V_SPECIFIC;
> -	} else if (version->major > 3 && *cptr == '\0')
> +	} else if (version->major > 3 && *cptr == '\0' &&
> +			version->v_mode == V_DEFAULT) /* v_mode has not been set */
>  		version->v_mode = V_GENERAL;
>  
>  	if (*cptr != '\0')
> diff --git a/utils/mount/network.h b/utils/mount/network.h
> index 9cc5dec..45e2b24 100644
> --- a/utils/mount/network.h
> +++ b/utils/mount/network.h
> @@ -58,10 +58,10 @@ int clnt_ping(struct sockaddr_in *, const unsigned long,
>  struct mount_options;
>  
>  enum {
> -	V_DEFAULT = 0,
> -	V_GENERAL,
> -	V_SPECIFIC,
> -	V_PARSE_ERR,
> +	V_DEFAULT = 0, /* not set */
> +	V_GENERAL,     /* single digit => 4 */
> +	V_SPECIFIC,    /* single digit < 4 or decimal included */
> +	V_PARSE_ERR,   /* miss all others */
>  };
>  
>  struct nfs_version {
> -- 
> 2.9.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2017-05-22  3:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 22:25 [PATCH 1/2] mount.nfs: v4 mounts should fail when -o flag is used Steve Dickson
2017-05-19 22:25 ` [PATCH 2/2] mount.nfs: v4 mounts should fail when nfs4 is specified with -t flag Steve Dickson
2017-05-22  3:03 ` NeilBrown [this message]
2017-05-22 14:30   ` [PATCH 1/2] mount.nfs: v4 mounts should fail when -o flag is used Steve Dickson
2017-05-23  0:52     ` NeilBrown
2017-05-31 15:33       ` Steve Dickson
2017-06-01  0:22         ` [PATCH] mount.nfs: improve version negotiation when vers=4 is specified NeilBrown
2017-06-01 14:02           ` Steve Dickson
2017-06-01  0:27         ` [PATCH 1/2] mount.nfs: v4 mounts should fail when -o flag is used NeilBrown

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=87inktk2yg.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /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).