Linux NFS development
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Neil Brown <neilb@suse.de>
Cc: chucklever@gmail.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] mount: enable retry for nfs23 to set the correct protocol for mount.
Date: Thu, 28 Aug 2008 11:35:31 -0400	[thread overview]
Message-ID: <48B6C5C3.5090903@RedHat.com> (raw)
In-Reply-To: <18559.57353.428342.328105-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>



Neil Brown wrote:
> On Friday July 18, neilb@suse.de wrote:
>> This is done over an unconnected socket so ICMP errors don't come back
>> (I think) so the timeout is all that clnt_call gets to know there is
>> an error... I wonder what would happen if we just changed that to be a
>> connected socket...
> 
> Yep, that was a good idea.
> The patch below causes a connected socket to be used when talking to
> portmap over UDP.  That means that we get ICMP errors back.
> And if we handle the errors correctly, we avoid the timeout.
> 
> With this added to all my other current patches, attempting to mount
> when udp/portmap is blocked succeeds in 90 seconds rather than 112
> seconds, and the 90 seconds is all in the mount system call.
> 
> If the kernel used connected UDP ports to talk to portmap, it might
> benefit too (didn't I see some emails about connected UDP ports in
> net/sunrpc recently - I'm afraid I didn't pay much attention).
> 
> NeilBrown
> 
> 
> From: NeilBrown <neilb@suse.de>
> 
> Use a connected port when talking to portmap via UDP.
> 
> This allows us to get ICMP errors reported back so we can avoid
> timeouts.  Also catch the error (RPC_CANTRECV) properly in getport.
> 
> Signed-off-by: NeilBrown <neilb@suse.de>
> 
> diff --git a/utils/mount/network.c b/utils/mount/network.c
> index 75354a7..ff50512 100644
> --- a/utils/mount/network.c
> +++ b/utils/mount/network.c
> @@ -447,7 +447,7 @@ static unsigned short getport(struct sockaddr_in *saddr,
>  	bind_saddr = *saddr;
>  	bind_saddr.sin_port = htons(PMAPPORT);
>  
> -	socket = get_socket(&bind_saddr, proto, PMAP_TIMEOUT, FALSE, FALSE);
> +	socket = get_socket(&bind_saddr, proto, PMAP_TIMEOUT, FALSE, TRUE);
>  	if (socket == RPC_ANYSOCK) {
>  		if (proto == IPPROTO_TCP &&
>  		    rpc_createerr.cf_error.re_errno == ETIMEDOUT)
> @@ -536,6 +536,7 @@ static int probe_port(clnt_addr_t *server, const unsigned long *versions,
>  		}
>  		if (rpc_createerr.cf_stat != RPC_PROGNOTREGISTERED &&
>  		    rpc_createerr.cf_stat != RPC_TIMEDOUT &&
> +		    rpc_createerr.cf_stat != RPC_CANTRECV &&
>  		    rpc_createerr.cf_stat != RPC_PROGVERSMISMATCH)
>  			goto out_bad;
>  
> @@ -544,7 +545,8 @@ static int probe_port(clnt_addr_t *server, const unsigned long *versions,
>  				continue;
>  			p_prot = protos;
>  		}
> -		if (rpc_createerr.cf_stat == RPC_TIMEDOUT)
> +		if (rpc_createerr.cf_stat == RPC_TIMEDOUT ||
> +		    rpc_createerr.cf_stat == RPC_CANTRECV)
>  			goto out_bad;
>  
>  		if (vers || !*++p_vers)

Committed....

steved.


  parent reply	other threads:[~2008-08-28 15:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-15 12:56 [PATCH] mount: enable retry for nfs23 to set the correct protocol for mount Neil Brown
     [not found] ` <18556.40594.897682.204554-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-07-15 15:11   ` Chuck Lever
     [not found]     ` <76bd70e30807150811p56feb02bo6e4a366d5577b398-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-16 17:12       ` Steve Dickson
2008-07-17  2:25         ` Neil Brown
     [not found]           ` <18558.44430.959865.662592-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-07-17 10:38             ` Steve Dickson
2008-07-17 22:50               ` Neil Brown
2008-07-17 23:15     ` Neil Brown
2008-07-18  0:12       ` Neil Brown
     [not found]         ` <18559.57353.428342.328105-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-07-18  4:54           ` Chuck Lever
2008-08-28 15:35           ` Steve Dickson [this message]
     [not found]       ` <18559.53893.95829.499988-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-07-19 16:09         ` Chuck Lever
2008-07-20  6:48           ` Neil Brown
     [not found]             ` <18562.57287.656749.540603-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-07-21  1:28               ` Chuck Lever
2008-07-21  2:49                 ` Neil Brown
2008-07-21  2:55                   ` Neil Brown
     [not found]                     ` <18563.64191.468427.481673-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-07-21 20:59                       ` Chuck Lever
     [not found]                   ` <18563.63821.501053.402741-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-07-21  4:43                     ` Chuck Lever
2008-07-21  6:06                       ` Neil Brown
     [not found]                         ` <18564.10115.809293.243948-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2008-07-21 15:32                           ` Chuck Lever
     [not found]                             ` <76bd70e30807210832l188bd3adl92762d5856bbaa5e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-07-21 17:40                               ` Trond Myklebust
2008-07-21 19:01                                 ` Chuck Lever
2008-07-21 17:23                           ` Chuck Lever

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=48B6C5C3.5090903@RedHat.com \
    --to=steved@redhat.com \
    --cc=chucklever@gmail.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