All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-nfs@vger.kernel.org, Suresh Jayaraman <sjayaraman@suse.de>
Subject: Re: [PATCH 2/2] supress socket error when address family is not supported
Date: Mon, 23 May 2011 08:26:21 -0400	[thread overview]
Message-ID: <4DDA526D.3020007@RedHat.com> (raw)
In-Reply-To: <20110517045217.29020.46681.stgit@notabene.brown>



On 05/17/2011 12:52 AM, Neil Brown wrote:
> From: Suresh Jayaraman <sjayaraman@suse.de>
> 
> It was observed that when ipv6 module was not loaded and cannot be auto-loaded,
> when starting NFS server, the following error occurs:
> 	"rpc.nfsd: unable to create inet6 TCP socket: errno 97 (Address
> 	family not supported by protocol)"
> 
> This is obviously a true message, but does not represent an "error" when ipv6
> is not enabled.  Rather, it is an expected condition.  As such, it can be
> confusing / misleading / distracting to display it in this scenario.
> 
> This patch instead of throwing error when a socket call fails with
> EAFNOSUPPORT, makes it as a NOTICE.
> 
> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
> Signed-off-by: Neil Brown <neilb@suse.de>
> ---
> 
>  utils/nfsd/nfssvc.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c
> index ea36399..f607214 100644
> --- a/utils/nfsd/nfssvc.c
> +++ b/utils/nfsd/nfssvc.c
> @@ -174,8 +174,13 @@ 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) {
> -			xlog(L_ERROR, "unable to create %s %s socket: "
> -				"errno %d (%m)", family, proto, errno);
> +			if (errno == EAFNOSUPPORT)
> +				xlog(L_NOTICE, "address family %s not "
> +						"supported by protocol %s",
> +						family, proto);
> +			else
> +				xlog(L_ERROR, "unable to create %s %s socket: "
> +				     "errno %d (%m)", family, proto, errno);
>  			rc = errno;
>  			goto error;
>  		}
> 
> 
Committed...

steved.

  parent reply	other threads:[~2011-05-23 12:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-17  4:52 [PATCH 0/2] Two small fixes for nfs-utils Neil Brown
2011-05-17  4:52 ` [PATCH 2/2] supress socket error when address family is not supported Neil Brown
     [not found]   ` <20110517045217.29020.46681.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2011-05-17  6:29     ` mount.nfs4: Mounting failed, reason given by server: No such file or directory Taousif_Ansari-G5Y5guI6XLZWk0Htik3J/w
2011-05-17  6:38       ` Mi Jinlong
2011-05-23 12:26   ` Steve Dickson [this message]
2011-05-17  4:52 ` [PATCH 1/2] Remove risk of nfs_addmntent corrupting mtab Neil Brown
2011-05-17 13:45   ` Chuck Lever
     [not found]   ` <20110517045217.29020.16140.stgit-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org>
2011-05-23 12:26     ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DDA526D.3020007@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=sjayaraman@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.