mount.nfs: Continue to trying address when the server return EACCES
Subsystems (2)
PATCH v2 1/2 mount.nfs: Continue to trying address when the server return EACCES
With recent changes to the /etc/hosts file, the 'localhost' host name is now multiply defined as both an IPv4 address (127.0.01) and an IPv6 address (::1). This causes first address returned by getaddrinfo('localhost') to be the IPv6 address instead of the IPv4 address.
The change in the default 'localhost' address type causes existing exports using '127.0.0.1' to fail, because the '::1' address is tried first and fails. The problem is not all the addresses in the address list are being tried.
So this patch allows that address list to continue to be process when a 'EACCES' error is returned by the server.
--- utils/mount/stropts.c | 2 ++ 1 file changed, 2 insertions(+)
utils/mount/stropts.c +2 -0
@@ -666,6 +666,7 @@ static int nfs_try_mount_v3v2(struct nfsmount_info *mi)case EOPNOTSUPP :case EHOSTUNREACH :case ETIMEDOUT : +case EACCES :continue ;default : goto out;
@@ -761,6 +762,7 @@ static int nfs_try_mount_v4(struct nfsmount_info *mi)case ECONNREFUSED :case EHOSTUNREACH :case ETIMEDOUT : +case EACCES :continue ;default : goto out;
Signature · 1 line
1.7.11.7
PATCH v2 2/2 mount.nfs: error message clean up.
Remove a unnecessary newline in an error message.
--- utils/mount/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
utils/mount/error.c +1 -1
@@ -225,7 +225,7 @@ void mount_error(const char *spec, const char *mount_point, int error)case ENOENT :if (spec)nfs_error (_ ("%s: mounting %s failed, " -"reason given by server:\n %s" ), +"reason given by server: %s" ), progname, spec,strerror (error));else nfs_error(_("%s: mount point %s does not exist"),
Signature · 1 line
1.7.11.7
Re: [PATCH 2/2 V2] mount.nfs: error message clean up.
Quoted 7 lines · Steve Dickson
Remove a unnecessary newline in an error message.
Signed-off-by Steve Dickson <[email protected]>--- utils/mount/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Committed....
steved.
Quoted 14 lines
utils/mount/error.c +1
-1@@ -225,7 +225,7 @@ void mount_error(const char *spec, const char *mount_point, int error)case ENOENT :if (spec)nfs_error (_ ("%s: mounting %s failed, " -"reason given by server:\n %s" ), +"reason given by server: %s" ), progname, spec,strerror (error));else nfs_error(_("%s: mount point %s does not exist"),
Quoted 11 lines · Steve Dickson
With recent changes to the
/etc/hostsfile, the 'localhost' host name is now multiply defined as both an IPv4 address (127.0.01) and an IPv6 address (::1). This causes first address returned by getaddrinfo('localhost') to be the IPv6 address instead of the IPv4 address.The change in the default 'localhost' address type causes existing exports using '127.0.0.1' to fail, because the '::1' address is tried first and fails. The problem is not all the addresses in the address list are being tried.
Quoted 4 lines
So this patch allows that address list to continue to be process when a 'EACCES' error is returned by the server.
Signed-off-by Steve Dickson <[email protected]>
Committed...
steved.
Quoted 25 lines
--- utils/mount/stropts.c | 2 ++ 1 file changed, 2 insertions(+)utils/mount/stropts.c +2
-0@@ -666,6 +666,7 @@ static int nfs_try_mount_v3v2(struct nfsmount_info *mi)case EOPNOTSUPP :case EHOSTUNREACH :case ETIMEDOUT : +case EACCES :continue ;default : goto out;@@ -761,6 +762,7 @@ static int nfs_try_mount_v4(struct nfsmount_info *mi)case ECONNREFUSED :case EHOSTUNREACH :case ETIMEDOUT : +case EACCES :continue ;default : goto out;