linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: Dick Streefland <dick@streefland.net>,
	rnews@altium.nl, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] retry for NFS v3 mounts
Date: Mon, 05 Dec 2011 09:50:47 -0500	[thread overview]
Message-ID: <4EDCDA47.4010702@RedHat.com> (raw)
In-Reply-To: <4ED7E678.2050104@RedHat.com>



On 12/01/2011 03:41 PM, Steve Dickson wrote:
> Hello,
> 
> On 12/01/2011 12:33 PM, rnews@altium.nl wrote:
>> > Mounting an NFS v3 volume from a server that is currently down,
>> > immediately fails with a timeout error, instead of retrying:
>> > 
>> > diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
>> > index 4032bf3..7ca0b3e 100644
>> > --- a/utils/mount/stropts.c
>> > +++ b/utils/mount/stropts.c
>> > @@ -663,6 +663,7 @@ static int nfs_try_mount_v3v2(struct nfsmount_info *mi)
>> >  		case ECONNREFUSED:
>> >  		case EOPNOTSUPP:
>> >  		case EHOSTUNREACH:
>> > +		case ESPIPE:
>> >  			continue;
>> >  		default:
>> >  			goto out;
>> > @@ -848,6 +849,7 @@ static int nfs_is_permanent_error(int error)
>> >  	case ETIMEDOUT:
>> >  	case ECONNREFUSED:
>> >  	case EHOSTUNREACH:
>> > +	case ESPIPE:
>> >  		return 0;	/* temporary */
>> >  	default:
>> >  		return 1;	/* permanent */
>> > 
> I think the problem is more of nfs_rewrite_pmap_mount_options()
> is not interrupting RPC correctly.... How about something like this:
> 
> Author: Steve Dickson <steved@redhat.com>
> Date:   Thu Dec 1 15:35:18 2011 -0500
> 
>     mount.nfs: Background mounts failing on time out errors.
>     
>     Mounting with the "-o v3,bg,proto=udp" options will
>     fail, instead of trying, when the server is down.
>     The reason being nfs_rewrite_pmap_mount_options()
>     is not interrupting RPC timeouts correctly.
>     
>     Signed-off-by: Steve Dickson <steved@redhat.com>
> 
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index 4032bf3..d52e21a 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -540,6 +540,8 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options
>                         errno = EOPNOTSUPP;
>                 else if (rpc_createerr.cf_stat == RPC_AUTHERROR)
>                         errno = EACCES;
> +               else if (rpc_createerr.cf_stat == RPC_TIMEDOUT)
> +                       errno = ETIMEDOUT;
>                 else if (rpc_createerr.cf_error.re_errno != 0)
>                         errno = rpc_createerr.cf_error.re_errno;
>                 return 0;
Committed...

steved.

      parent reply	other threads:[~2011-12-05 14:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 17:33 [PATCH] retry for NFS v3 mounts Dick Streefland, rnews
2011-12-01 20:41 ` Steve Dickson
2011-12-02  9:47   ` Dick Streefland, rnews
2011-12-05 14:50   ` Steve Dickson [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=4EDCDA47.4010702@RedHat.com \
    --to=steved@redhat.com \
    --cc=dick@streefland.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rnews@altium.nl \
    /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).