* nfs-utils regression on IPv6-less kernels
@ 2015-08-10 13:13 Christoph Hellwig
2015-08-11 10:48 ` Steve Dickson
0 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2015-08-10 13:13 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs
Hi Steve,
since commit "ipv6: Enable IPv6 support by default." rpc.mountd
fails to start on a kernel without IPv6 support. Seems like it
doesn't have a proper fallback if an address family isn't implemented.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils regression on IPv6-less kernels
2015-08-10 13:13 nfs-utils regression on IPv6-less kernels Christoph Hellwig
@ 2015-08-11 10:48 ` Steve Dickson
2015-08-17 12:42 ` Christoph Hellwig
0 siblings, 1 reply; 9+ messages in thread
From: Steve Dickson @ 2015-08-11 10:48 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-nfs
Hey,
On 08/10/2015 09:13 AM, Christoph Hellwig wrote:
> Hi Steve,
>
> since commit "ipv6: Enable IPv6 support by default." rpc.mountd
> fails to start on a kernel without IPv6 support. Seems like it
> doesn't have a proper fallback if an address family isn't implemented.
>
hmm... What do you mean "fails to start"... are there any error messages?
If nfs-utils is compiled with the --disable_ipv6 flag, does
the same problem happen?
Note, I'm going on holiday for the next couple weeks so my
response time might be a bit spotty...
steved.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils regression on IPv6-less kernels
2015-08-11 10:48 ` Steve Dickson
@ 2015-08-17 12:42 ` Christoph Hellwig
2015-08-17 15:40 ` Chuck Lever
0 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2015-08-17 12:42 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs
On Tue, Aug 11, 2015 at 06:48:18AM -0400, Steve Dickson wrote:
> hmm... What do you mean "fails to start"... are there any error messages?
[....] Starting NFS kernel daemon: nfsdrpc.nfsd: address family AF_INET6
not supported by protocol TCP
rpc.nfsd: unable to set any sockets for nfsd
failed!
And then any attempts to mount from this machine fail.
> If nfs-utils is compiled with the --disable_ipv6 flag, does
> the same problem happen?
No, that fixes it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils regression on IPv6-less kernels
2015-08-17 12:42 ` Christoph Hellwig
@ 2015-08-17 15:40 ` Chuck Lever
2015-08-17 16:06 ` Christoph Hellwig
0 siblings, 1 reply; 9+ messages in thread
From: Chuck Lever @ 2015-08-17 15:40 UTC (permalink / raw)
To: Christoph Hellwig, Steve Dickson; +Cc: Linux NFS Mailing List
On Aug 17, 2015, at 5:42 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Tue, Aug 11, 2015 at 06:48:18AM -0400, Steve Dickson wrote:
>> hmm... What do you mean "fails to start"... are there any error messages?
>
> [....] Starting NFS kernel daemon: nfsdrpc.nfsd: address family AF_INET6
> not supported by protocol TCP
> rpc.nfsd: unable to set any sockets for nfsd
> failed!
>
> And then any attempts to mount from this machine fail.
>
>> If nfs-utils is compiled with the --disable_ipv6 flag, does
>> the same problem happen?
>
> No, that fixes it.
Probably stopped working with "rpc.nfsd: Squelch DNS errors when
using --host option".
getaddrinfo(3) returns a list of addresses, some of which are
IPv6 addresses. It gets the list from /etc/hosts, or DNS. Even
on kernels which do not support IPv6, there may be at least one
IPv6 address in the list.
nfssvc_setfds() then loops over this list. The error handling
in nfssvc_setfds() causes the loop to exit if the socket(2)
call fails. It should "continue" if the error is EAFNOSUPPORT.
In fact, that xlog notice can also be removed.
I'm traveling this week. Is this enough for you to generate a
fix?
--
Chuck Lever
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils regression on IPv6-less kernels
2015-08-17 15:40 ` Chuck Lever
@ 2015-08-17 16:06 ` Christoph Hellwig
2015-08-17 16:09 ` Chuck Lever
2015-09-09 15:47 ` Steve Dickson
0 siblings, 2 replies; 9+ messages in thread
From: Christoph Hellwig @ 2015-08-17 16:06 UTC (permalink / raw)
To: Chuck Lever; +Cc: Steve Dickson, Linux NFS Mailing List
On Mon, Aug 17, 2015 at 08:40:25AM -0700, Chuck Lever wrote:
> Probably stopped working with "rpc.nfsd: Squelch DNS errors when
> using --host option".
>
> getaddrinfo(3) returns a list of addresses, some of which are
> IPv6 addresses. It gets the list from /etc/hosts, or DNS. Even
> on kernels which do not support IPv6, there may be at least one
> IPv6 address in the list.
>
> nfssvc_setfds() then loops over this list. The error handling
> in nfssvc_setfds() causes the loop to exit if the socket(2)
> call fails. It should "continue" if the error is EAFNOSUPPORT.
> In fact, that xlog notice can also be removed.
>
> I'm traveling this week. Is this enough for you to generate a
> fix?
Yes, that works:
---
From: Christoph Hellwig <hch@lst.de>
Subject: nfsd: ignore unsupported address types in nfssvc_setfds
Just continue and try a different record returned from getaddrinfo
if the kernel does not support an address family. This fixes nfsd
startup on kernels without IPv6 support.
Suggested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
index a2b11d8..fc11d23 100644
--- a/utils/nfsd/nfssvc.c
+++ b/utils/nfsd/nfssvc.c
@@ -174,15 +174,14 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
sockfd = socket(addr->ai_family, addr->ai_socktype,
addr->ai_protocol);
if (sockfd < 0) {
- if (errno == EAFNOSUPPORT)
- xlog(L_NOTICE, "address family %s not "
- "supported by protocol %s",
- family, proto);
- else
+ if (errno != EAFNOSUPPORT) {
xlog(L_ERROR, "unable to create %s %s socket: "
"errno %d (%m)", family, proto, errno);
- rc = errno;
- goto error;
+ rc = errno;
+ goto error;
+ }
+ addr = addr->ai_next;
+ continue;
}
#ifdef IPV6_SUPPORTED
if (addr->ai_family == AF_INET6 &&
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: nfs-utils regression on IPv6-less kernels
2015-08-17 16:06 ` Christoph Hellwig
@ 2015-08-17 16:09 ` Chuck Lever
2015-09-09 15:47 ` Steve Dickson
1 sibling, 0 replies; 9+ messages in thread
From: Chuck Lever @ 2015-08-17 16:09 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Steve Dickson, Linux NFS Mailing List
On Aug 17, 2015, at 9:06 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Mon, Aug 17, 2015 at 08:40:25AM -0700, Chuck Lever wrote:
>> Probably stopped working with "rpc.nfsd: Squelch DNS errors when
>> using --host option".
>>
>> getaddrinfo(3) returns a list of addresses, some of which are
>> IPv6 addresses. It gets the list from /etc/hosts, or DNS. Even
>> on kernels which do not support IPv6, there may be at least one
>> IPv6 address in the list.
>>
>> nfssvc_setfds() then loops over this list. The error handling
>> in nfssvc_setfds() causes the loop to exit if the socket(2)
>> call fails. It should "continue" if the error is EAFNOSUPPORT.
>> In fact, that xlog notice can also be removed.
>>
>> I'm traveling this week. Is this enough for you to generate a
>> fix?
>
> Yes, that works:
>
> ---
> From: Christoph Hellwig <hch@lst.de>
> Subject: nfsd: ignore unsupported address types in nfssvc_setfds
>
> Just continue and try a different record returned from getaddrinfo
> if the kernel does not support an address family. This fixes nfsd
> startup on kernels without IPv6 support.
>
> Suggested-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Yep, that's what I was thinking.
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
And maybe add a "Fixes: 2f8a6020of4c rpc.nfsd: yada"
at your discretion.
> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> index a2b11d8..fc11d23 100644
> --- a/utils/nfsd/nfssvc.c
> +++ b/utils/nfsd/nfssvc.c
> @@ -174,15 +174,14 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
> sockfd = socket(addr->ai_family, addr->ai_socktype,
> addr->ai_protocol);
> if (sockfd < 0) {
> - if (errno == EAFNOSUPPORT)
> - xlog(L_NOTICE, "address family %s not "
> - "supported by protocol %s",
> - family, proto);
> - else
> + if (errno != EAFNOSUPPORT) {
> xlog(L_ERROR, "unable to create %s %s socket: "
> "errno %d (%m)", family, proto, errno);
> - rc = errno;
> - goto error;
> + rc = errno;
> + goto error;
> + }
> + addr = addr->ai_next;
> + continue;
> }
> #ifdef IPV6_SUPPORTED
> if (addr->ai_family == AF_INET6 &&
--
Chuck Lever
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils regression on IPv6-less kernels
2015-08-17 16:06 ` Christoph Hellwig
2015-08-17 16:09 ` Chuck Lever
@ 2015-09-09 15:47 ` Steve Dickson
2015-10-29 21:22 ` Chuck Lever
1 sibling, 1 reply; 9+ messages in thread
From: Steve Dickson @ 2015-09-09 15:47 UTC (permalink / raw)
To: Christoph Hellwig, Chuck Lever; +Cc: Linux NFS Mailing List
On 08/17/2015 12:06 PM, Christoph Hellwig wrote:
> On Mon, Aug 17, 2015 at 08:40:25AM -0700, Chuck Lever wrote:
>> Probably stopped working with "rpc.nfsd: Squelch DNS errors when
>> using --host option".
>>
>> getaddrinfo(3) returns a list of addresses, some of which are
>> IPv6 addresses. It gets the list from /etc/hosts, or DNS. Even
>> on kernels which do not support IPv6, there may be at least one
>> IPv6 address in the list.
>>
>> nfssvc_setfds() then loops over this list. The error handling
>> in nfssvc_setfds() causes the loop to exit if the socket(2)
>> call fails. It should "continue" if the error is EAFNOSUPPORT.
>> In fact, that xlog notice can also be removed.
>>
>> I'm traveling this week. Is this enough for you to generate a
>> fix?
>
> Yes, that works:
>
> ---
> From: Christoph Hellwig <hch@lst.de>
> Subject: nfsd: ignore unsupported address types in nfssvc_setfds
>
> Just continue and try a different record returned from getaddrinfo
> if the kernel does not support an address family. This fixes nfsd
> startup on kernels without IPv6 support.
>
> Suggested-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Sorry it took so long... committed!
steved.
>
> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> index a2b11d8..fc11d23 100644
> --- a/utils/nfsd/nfssvc.c
> +++ b/utils/nfsd/nfssvc.c
> @@ -174,15 +174,14 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
> sockfd = socket(addr->ai_family, addr->ai_socktype,
> addr->ai_protocol);
> if (sockfd < 0) {
> - if (errno == EAFNOSUPPORT)
> - xlog(L_NOTICE, "address family %s not "
> - "supported by protocol %s",
> - family, proto);
> - else
> + if (errno != EAFNOSUPPORT) {
> xlog(L_ERROR, "unable to create %s %s socket: "
> "errno %d (%m)", family, proto, errno);
> - rc = errno;
> - goto error;
> + rc = errno;
> + goto error;
> + }
> + addr = addr->ai_next;
> + continue;
> }
> #ifdef IPV6_SUPPORTED
> if (addr->ai_family == AF_INET6 &&
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils regression on IPv6-less kernels
2015-09-09 15:47 ` Steve Dickson
@ 2015-10-29 21:22 ` Chuck Lever
2015-10-30 13:22 ` Steve Dickson
0 siblings, 1 reply; 9+ messages in thread
From: Chuck Lever @ 2015-10-29 21:22 UTC (permalink / raw)
To: Steve Dickson; +Cc: Christoph Hellwig, Linux NFS Mailing List
> On Sep 9, 2015, at 11:47 AM, Steve Dickson <SteveD@redhat.com> wrote:
>
>
>
> On 08/17/2015 12:06 PM, Christoph Hellwig wrote:
>> On Mon, Aug 17, 2015 at 08:40:25AM -0700, Chuck Lever wrote:
>>> Probably stopped working with "rpc.nfsd: Squelch DNS errors when
>>> using --host option".
>>>
>>> getaddrinfo(3) returns a list of addresses, some of which are
>>> IPv6 addresses. It gets the list from /etc/hosts, or DNS. Even
>>> on kernels which do not support IPv6, there may be at least one
>>> IPv6 address in the list.
>>>
>>> nfssvc_setfds() then loops over this list. The error handling
>>> in nfssvc_setfds() causes the loop to exit if the socket(2)
>>> call fails. It should "continue" if the error is EAFNOSUPPORT.
>>> In fact, that xlog notice can also be removed.
>>>
>>> I'm traveling this week. Is this enough for you to generate a
>>> fix?
>>
>> Yes, that works:
>>
>> ---
>> From: Christoph Hellwig <hch@lst.de>
>> Subject: nfsd: ignore unsupported address types in nfssvc_setfds
>>
>> Just continue and try a different record returned from getaddrinfo
>> if the kernel does not support an address family. This fixes nfsd
>> startup on kernels without IPv6 support.
>>
>> Suggested-by: Chuck Lever <chuck.lever@oracle.com>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Sorry it took so long... committed!
I’m pulling from git://linux-nfs.org/nfs-utils but I
don’t see this commit. What’s the correct URL to pull
from for upstream nfs-utils?
> steved.
>
>>
>> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
>> index a2b11d8..fc11d23 100644
>> --- a/utils/nfsd/nfssvc.c
>> +++ b/utils/nfsd/nfssvc.c
>> @@ -174,15 +174,14 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
>> sockfd = socket(addr->ai_family, addr->ai_socktype,
>> addr->ai_protocol);
>> if (sockfd < 0) {
>> - if (errno == EAFNOSUPPORT)
>> - xlog(L_NOTICE, "address family %s not "
>> - "supported by protocol %s",
>> - family, proto);
>> - else
>> + if (errno != EAFNOSUPPORT) {
>> xlog(L_ERROR, "unable to create %s %s socket: "
>> "errno %d (%m)", family, proto, errno);
>> - rc = errno;
>> - goto error;
>> + rc = errno;
>> + goto error;
>> + }
>> + addr = addr->ai_next;
>> + continue;
>> }
>> #ifdef IPV6_SUPPORTED
>> if (addr->ai_family == AF_INET6 &&
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
—
Chuck Lever
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: nfs-utils regression on IPv6-less kernels
2015-10-29 21:22 ` Chuck Lever
@ 2015-10-30 13:22 ` Steve Dickson
0 siblings, 0 replies; 9+ messages in thread
From: Steve Dickson @ 2015-10-30 13:22 UTC (permalink / raw)
To: Chuck Lever; +Cc: Christoph Hellwig, Linux NFS Mailing List
On 10/29/2015 05:22 PM, Chuck Lever wrote:
>
>> On Sep 9, 2015, at 11:47 AM, Steve Dickson <SteveD@redhat.com> wrote:
>>
>>
>>
>> On 08/17/2015 12:06 PM, Christoph Hellwig wrote:
>>> On Mon, Aug 17, 2015 at 08:40:25AM -0700, Chuck Lever wrote:
>>>> Probably stopped working with "rpc.nfsd: Squelch DNS errors when
>>>> using --host option".
>>>>
>>>> getaddrinfo(3) returns a list of addresses, some of which are
>>>> IPv6 addresses. It gets the list from /etc/hosts, or DNS. Even
>>>> on kernels which do not support IPv6, there may be at least one
>>>> IPv6 address in the list.
>>>>
>>>> nfssvc_setfds() then loops over this list. The error handling
>>>> in nfssvc_setfds() causes the loop to exit if the socket(2)
>>>> call fails. It should "continue" if the error is EAFNOSUPPORT.
>>>> In fact, that xlog notice can also be removed.
>>>>
>>>> I'm traveling this week. Is this enough for you to generate a
>>>> fix?
>>>
>>> Yes, that works:
>>>
>>> ---
>>> From: Christoph Hellwig <hch@lst.de>
>>> Subject: nfsd: ignore unsupported address types in nfssvc_setfds
>>>
>>> Just continue and try a different record returned from getaddrinfo
>>> if the kernel does not support an address family. This fixes nfsd
>>> startup on kernels without IPv6 support.
>>>
>>> Suggested-by: Chuck Lever <chuck.lever@oracle.com>
>>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> Sorry it took so long... committed!
>
> I’m pulling from git://linux-nfs.org/nfs-utils but I
> don’t see this commit. What’s the correct URL to pull
> from for upstream nfs-utils?
Well it is Halloween so maybe a spook got or I did the
commit and forgot to do the push... One of those two
happen! ;-)
Its there now... Sorry for the confusion...
steved.
>
>
>> steved.
>>
>>>
>>> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
>>> index a2b11d8..fc11d23 100644
>>> --- a/utils/nfsd/nfssvc.c
>>> +++ b/utils/nfsd/nfssvc.c
>>> @@ -174,15 +174,14 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
>>> sockfd = socket(addr->ai_family, addr->ai_socktype,
>>> addr->ai_protocol);
>>> if (sockfd < 0) {
>>> - if (errno == EAFNOSUPPORT)
>>> - xlog(L_NOTICE, "address family %s not "
>>> - "supported by protocol %s",
>>> - family, proto);
>>> - else
>>> + if (errno != EAFNOSUPPORT) {
>>> xlog(L_ERROR, "unable to create %s %s socket: "
>>> "errno %d (%m)", family, proto, errno);
>>> - rc = errno;
>>> - goto error;
>>> + rc = errno;
>>> + goto error;
>>> + }
>>> + addr = addr->ai_next;
>>> + continue;
>>> }
>>> #ifdef IPV6_SUPPORTED
>>> if (addr->ai_family == AF_INET6 &&
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> —
> Chuck Lever
>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-10-30 13:22 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-10 13:13 nfs-utils regression on IPv6-less kernels Christoph Hellwig
2015-08-11 10:48 ` Steve Dickson
2015-08-17 12:42 ` Christoph Hellwig
2015-08-17 15:40 ` Chuck Lever
2015-08-17 16:06 ` Christoph Hellwig
2015-08-17 16:09 ` Chuck Lever
2015-09-09 15:47 ` Steve Dickson
2015-10-29 21:22 ` Chuck Lever
2015-10-30 13:22 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).