* [PATCH] retry for NFS v3 mounts
@ 2011-12-01 17:33 Dick Streefland, rnews
2011-12-01 20:41 ` Steve Dickson
0 siblings, 1 reply; 4+ messages in thread
From: Dick Streefland, rnews @ 2011-12-01 17:33 UTC (permalink / raw)
To: linux-nfs
Mounting an NFS v3 volume from a server that is currently down,
immediately fails with a timeout error, instead of retrying:
# mount -t nfs -v -overs=3,proto=udp,bg server:/foo /mnt
mount.nfs: trying text-based options 'vers=3,proto=udp,bg,addr=172.17.2.94'
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Timed out
mount.nfs: mount to NFS server 'server:/foo' failed: timed out, giving up
# mount -t nfs -v -overs=3,proto=tcp,bg server:/foo /mnt
mount.nfs: trying text-based options 'vers=3,proto=tcp,bg,addr=172.17.2.94'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query failed: RPC: Remote system error - No route to host
mount.nfs: No route to host
As a result, NFS mounts may not come up after a power failure when the
client boots faster than the server. The attached patch for nfs-utils
adds ESPIPE to the list of errors considered temporary, so that the
mount will be retried:
# mount -t nfs -v -overs=3,proto=udp,bg server:/foo /mnt
mount.nfs: trying text-based options 'vers=3,proto=udp,bg,addr=172.17.2.94'
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Timed out
mount.nfs: backgrounding "server:/foo"
mount.nfs: mount options: "vers=3,proto=udp,bg,addr=172.17.2.94"
# mount -t nfs -v -overs=3,proto=tcp,bg server:/foo /mnt
mount.nfs: trying text-based options 'vers=3,proto=tcp,bg,addr=172.17.2.94'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query failed: RPC: Remote system error - No route to host
mount.nfs: backgrounding "server:/foo"
mount.nfs: mount options: "vers=3,proto=tcp,bg,addr=172.17.2.94"
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 */
--
Dick
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] retry for NFS v3 mounts
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
0 siblings, 2 replies; 4+ messages in thread
From: Steve Dickson @ 2011-12-01 20:41 UTC (permalink / raw)
To: Dick Streefland; +Cc: rnews, linux-nfs
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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] retry for NFS v3 mounts
2011-12-01 20:41 ` Steve Dickson
@ 2011-12-02 9:47 ` Dick Streefland, rnews
2011-12-05 14:50 ` Steve Dickson
1 sibling, 0 replies; 4+ messages in thread
From: Dick Streefland, rnews @ 2011-12-02 9:47 UTC (permalink / raw)
To: linux-nfs
Steve Dickson <SteveD@redhat.com> wrote:
| I think the problem is more of nfs_rewrite_pmap_mount_options()
| is not interrupting RPC correctly.... How about something like this:
[...]
| + else if (rpc_createerr.cf_stat == RPC_TIMEDOUT)
| + errno = ETIMEDOUT;
OK, that works as well.
--
Dick
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] retry for NFS v3 mounts
2011-12-01 20:41 ` Steve Dickson
2011-12-02 9:47 ` Dick Streefland, rnews
@ 2011-12-05 14:50 ` Steve Dickson
1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2011-12-05 14:50 UTC (permalink / raw)
To: Steve Dickson; +Cc: Dick Streefland, rnews, linux-nfs
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-05 14:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).