diff options
author | NeilBrown <neilb@suse.de> | 2014-03-11 11:11:10 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-03-13 10:35:05 -0400 |
commit | 65ac59cdef494f4a439feace258e35f226ae210b (patch) | |
tree | 78c4bd55a249fa00c9f7ba7c954a9f9971a9c296 /utils/mount/network.h | |
parent | e7afd5f3a2a945b3162f0a300c7ed37a861a9dbd (diff) | |
download | nfs-utils-65ac59cdef494f4a439feace258e35f226ae210b.tar.gz nfs-utils-65ac59cdef494f4a439feace258e35f226ae210b.tar.xz nfs-utils-65ac59cdef494f4a439feace258e35f226ae210b.zip |
[PATCH - v3] mount.nfs: Fix fallback from tcp to udp
Protocol negotiation in mount.nfs does not correctly negotiate with a
server which only supports NFSv3 and UDP.
When mount.nfs attempts an NFSv4 mount and fails with ECONNREFUSED
it does not fall back to NFSv3, as this is not recognised as a
"does not support NFSv4" error.
However ECONNREFUSED is a clear indication that the server doesn't
support TCP, and ipso facto does not support NFSv4.
So ECONNREFUSED should trigger a fallback from v4 to v2/3.
However ECONNREFUSED may simply indicate that NFSv4 isn't supported
*yet*. i.e. the server is still booting and isn't responding to NFS
requests yet. So if we subsequently find that NFSv3 is supported, we
need to check with the server to confirm that NFSv4 really isn't
supported.
If server reports that v4 is not supported after reporting that v3
is, we can safely use v4. If it reports that v4 is supported, we need
to retry v4.
Signed-off-by: Steve Dickson <steved@redhat.com>
Reported-by: Carsten Ziepke <kieltux@gmail.com>
Diffstat (limited to 'utils/mount/network.h')
-rw-r--r-- | utils/mount/network.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/mount/network.h b/utils/mount/network.h index 9c75856..d7636d7 100644 --- a/utils/mount/network.h +++ b/utils/mount/network.h @@ -42,7 +42,7 @@ static const struct timeval RETRY_TIMEOUT = { 3, 0 }; int probe_bothports(clnt_addr_t *, clnt_addr_t *); int nfs_probe_bothports(const struct sockaddr *, const socklen_t, struct pmap *, const struct sockaddr *, - const socklen_t, struct pmap *); + const socklen_t, struct pmap *, int); int nfs_gethostbyname(const char *, struct sockaddr_in *); int nfs_lookup(const char *hostname, const sa_family_t family, struct sockaddr *sap, socklen_t *salen); |