All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Steve Dickson <steved@redhat.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH - v3] mount.nfs: Fix fallback from tcp to udp
Date: Wed, 12 Mar 2014 16:55:26 +1100	[thread overview]
Message-ID: <20140312165526.76332207@notabene.brown> (raw)
In-Reply-To: <1394551050-14571-1-git-send-email-steved@redhat.com>

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

On Tue, 11 Mar 2014 11:17:30 -0400 Steve Dickson <steved@redhat.com> wrote:

> From: NeilBrown <neilb@suse.de>
> 
> Protocol negotiation in mount.nfs does not correctly negotiate with a
> server which only supports NFSv3 and UDP.
> 
> When mount.nfs attempts an NFSv4 mount and fails with ECONNREFUSED
> it does not fall back to NFSv3, as this is not recognised as a
> "does not support NFSv4" error.
> However ECONNREFUSED is a clear indication that the server doesn't
> support TCP, and ipso facto does not support NFSv4.
> So ECONNREFUSED should trigger a fallback from v4 to v2/3.
> 
> However ECONNREFUSED may simply indicate that NFSv4 isn't supported
> *yet*.  i.e. the server is still booting and isn't responding to NFS
> requests yet.  So if we subsequently find that NFSv3 is supported, we
> need to check with the server to confirm that NFSv4 really isn't
> supported.
> 
> If server reports that v4 is not supported after reporting that v3
> is, we can safely use v4.  If it reports that v4 is supported, we need
> to retry v4.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
> Reported-by: Carsten Ziepke <kieltux@gmail.com>
> ---


> +		memcpy(&save_sa, sap, salen);
> +
> +		ret = nfs_probe_port(sap, salen, pmap,
> +				     probe_nfs3_only, probe_proto);
> +		if (!ret || !checkv4 || probe_proto != probe_tcp_first)
> +			return ret;
> +
> +		nfs_set_port((struct sockaddr *)&save_sa, NFS_PORT);
> +		ret =  nfs_rpc_ping((struct sockaddr *)&save_sa, salen, 
> +			NFS_PROGRAM, 4, IPPROTO_TCP, NULL);

That turns out to be very neat, doesn't it?
I'm quite happy with this version instead.

Thanks,
NeilBrown

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

  reply	other threads:[~2014-03-12  5:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 15:17 [PATCH - v3] mount.nfs: Fix fallback from tcp to udp Steve Dickson
2014-03-12  5:55 ` NeilBrown [this message]
2014-03-13 14:35 ` Steve Dickson

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=20140312165526.76332207@notabene.brown \
    --to=neilb@suse.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.