summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2016-08-20 10:39:52 -0400
committerSteve Dickson <steved@redhat.com>2016-08-22 08:50:58 -0400
commitdf0b99980d74505299e9289c2ccddd03a48b664f (patch)
tree2de19769d5d4715cc4ea56f1729066c62c729e75
parent4776bd0599420f9d073c9e2601ed438062dccd19 (diff)
downloadnfs-utils-df0b99980d74505299e9289c2ccddd03a48b664f.tar.gz
nfs-utils-df0b99980d74505299e9289c2ccddd03a48b664f.tar.xz
nfs-utils-df0b99980d74505299e9289c2ccddd03a48b664f.zip
mount: RPC_PROGNOTREGISTERED should not be a permanent error
Commit: bf66c9facb8e ("mounts.nfs: v2 and v3 background mounts should retry when server is down.") changed the behaviour of "bg" mounts so that RPC_PROGNOTREGISTERED, which maps to EOPNOTSUPP, is not a permanent error. This useful because when an NFS server starts up there is a small window between the moment that rpcbind (or portmap) starts responding to lookup requests, and the moment when nfsd registers with rpcbind. During that window rpcbind will reply with RPC_PROGNOTREGISTERED, but mount should not give up. This same reasoning applies to foreground mounts. They don't wait for as long, but could still hit the window and fail prematurely. So revert the above patch and instead add EOPNOTSUPP to the list of temporary errors known to nfs_is_permanent_error. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/mount/stropts.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 9de6794..d5dfb5e 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -948,6 +948,7 @@ static int nfs_is_permanent_error(int error)
case ETIMEDOUT:
case ECONNREFUSED:
case EHOSTUNREACH:
+ case EOPNOTSUPP: /* aka RPC_PROGNOTREGISTERED */
case EAGAIN:
return 0; /* temporary */
default:
@@ -1019,8 +1020,7 @@ static int nfsmount_parent(struct nfsmount_info *mi)
if (nfs_try_mount(mi))
return EX_SUCCESS;
- /* retry background mounts when the server is not up */
- if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) {
+ if (nfs_is_permanent_error(errno)) {
mount_error(mi->spec, mi->node, errno);
return EX_FAIL;
}
@@ -1055,8 +1055,7 @@ static int nfsmount_child(struct nfsmount_info *mi)
if (nfs_try_mount(mi))
return EX_SUCCESS;
- /* retry background mounts when the server is not up */
- if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP)
+ if (nfs_is_permanent_error(errno))
break;
if (time(NULL) > timeout)