X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fmount%2Fstropts.c;h=0aa9a7586dbe6eadf877450e715844907a9aa945;hb=78ee5f378f295e7bff24a7be41b9361f406d4f8b;hp=314a806799bbe83ed8e805b94059726f152bb898;hpb=80936369ba84e161c324116658e074c830dcaf55;p=nfs-utils.git diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 314a806..0aa9a75 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; @@ -663,11 +665,13 @@ static int nfs_try_mount_v3v2(struct nfsmount_info *mi) case ECONNREFUSED: case EOPNOTSUPP: case EHOSTUNREACH: + case ETIMEDOUT: continue; default: - break; + goto out; } } +out: return ret; } @@ -749,11 +753,13 @@ static int nfs_try_mount_v4(struct nfsmount_info *mi) switch (errno) { case ECONNREFUSED: case EHOSTUNREACH: + case ETIMEDOUT: continue; default: - break; + goto out; } } +out: return ret; } @@ -907,7 +913,8 @@ static int nfsmount_parent(struct nfsmount_info *mi) if (nfs_try_mount(mi)) return EX_SUCCESS; - if (nfs_is_permanent_error(errno)) { + /* retry background mounts when the server is not up */ + if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) { mount_error(mi->spec, mi->node, errno); return EX_FAIL; } @@ -942,7 +949,8 @@ static int nfsmount_child(struct nfsmount_info *mi) if (nfs_try_mount(mi)) return EX_SUCCESS; - if (nfs_is_permanent_error(errno)) + /* retry background mounts when the server is not up */ + if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) break; if (time(NULL) > timeout)