Re: [PATCH 3/3] NFSD: Enable NFS server use of PF_INET6

J. Bruce Fields
2010-01-15T22:34:09Z

On Wed, Jan 13, 2010 at 04:10:48PM -0500, Chuck Lever wrote:
> Try to use an PF_INET6 listener for NFSD if IPv6 is enabled in the
> kernel.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
>
> fs/nfsd/nfsctl.c | 36 +++++++++++++++++++++++++++++-------
> fs/nfsd/nfssvc.c | 27 ++++++++++++++++++++++-----
> 2 files changed, 51 insertions(+), 12 deletions(-)
>
> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index 2604c3e..7ebb7a5 100644
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@ -981,6 +981,26 @@ static ssize_t __write_ports_delfd(char *buf)
> return len;
> }
>
> +static ssize_t __write_ports_create_xprt(struct svc_serv *serv,
> + const char *transport,
> + const int family,
> + const unsigned short port)
> +{
> + int err;
> +
> + err = svc_create_xprt(serv, transport, family, port,
> + SVC_SOCK_ANONYMOUS);
> +
> + if (err < 0) {
> + /* Give a reasonable perror msg for bad transport string */
> + if (err == -ENOENT)
> + err = -EPROTONOSUPPORT;

I realize you're just moving this code, not writing it, so this is a
separate question, but: it looks like it's svc_create_xprt() itself that
chooses ENOENT for this case. Is there any reason it shouldn't just use
EPROTONOSUPPORT from the start?

--b.