summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dd0761b)
The latest versions of mount.nfs appear not to fall back to
UDP if TCP isn't available on the server.
Our new nfs_getport() implementation is missing a bit of logic
from the original mount getport() implementation. Without it,
nfs_probe_port() sees a TCP connect timeout as a permanent error,
so it fails immediately instead of attempting to try again with
UDP.
Similar changes for our new ping API (see the old clnt_ping()
function, which is still in utils/mount/network.c).
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
static const rpcvers_t default_rpcb_version = PMAPVERS;
#endif /* !HAVE_LIBTIRPC */
static const rpcvers_t default_rpcb_version = PMAPVERS;
#endif /* !HAVE_LIBTIRPC */
+/*
+ * Historical: Map TCP connect timeouts to timeout
+ * error code used by UDP.
+ */
+static void
+nfs_gp_map_tcp_errorcodes(const unsigned short protocol)
+{
+ if (protocol != IPPROTO_TCP)
+ return;
+
+ switch (rpc_createerr.cf_error.re_errno) {
+ case ETIMEDOUT:
+ rpc_createerr.cf_stat = RPC_TIMEDOUT;
+ break;
+ }
+}
+
/*
* There's no easy way to tell how the local system's networking
* and rpcbind is configured (ie. whether we want to use IPv6 or
/*
* There's no easy way to tell how the local system's networking
* and rpcbind is configured (ie. whether we want to use IPv6 or
NULL,
};
rpcprog_t rpcb_prog = nfs_getrpcbyname(RPCBPROG, rpcb_pgmtbl);
NULL,
};
rpcprog_t rpcb_prog = nfs_getrpcbyname(RPCBPROG, rpcb_pgmtbl);
nfs_gp_set_port(sap, nfs_gp_get_rpcb_port(transport));
nfs_gp_set_port(sap, nfs_gp_get_rpcb_port(transport));
- return nfs_get_rpcclient(sap, salen, transport, rpcb_prog,
- version, timeout);
+ clnt = nfs_get_rpcclient(sap, salen, transport, rpcb_prog,
+ version, timeout);
+ nfs_gp_map_tcp_errorcodes(transport);
+ return clnt;
program, version, &tout);
if (client != NULL) {
result = nfs_gp_ping(client, tout);
program, version, &tout);
if (client != NULL) {
result = nfs_gp_ping(client, tout);
+ nfs_gp_map_tcp_errorcodes(protocol);
program, version, &timeout);
if (client != NULL) {
result = nfs_gp_ping(client, timeout);
program, version, &timeout);
if (client != NULL) {
result = nfs_gp_ping(client, timeout);
+ nfs_gp_map_tcp_errorcodes(protocol);
CLNT_DESTROY(client);
}
}
CLNT_DESTROY(client);
}
}