From patchwork Tue May 17 04:52:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 790392 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4H4rKfU002915 for ; Tue, 17 May 2011 04:53:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751296Ab1EQExS (ORCPT ); Tue, 17 May 2011 00:53:18 -0400 Received: from cantor.suse.de ([195.135.220.2]:49754 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007Ab1EQExS (ORCPT ); Tue, 17 May 2011 00:53:18 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id BD6A594393; Tue, 17 May 2011 06:53:17 +0200 (CEST) From: Neil Brown To: Steve Dickson Date: Tue, 17 May 2011 14:52:17 +1000 Subject: [PATCH 2/2] supress socket error when address family is not supported Cc: linux-nfs@vger.kernel.org, Suresh Jayaraman , Neil Brown Message-ID: <20110517045217.29020.46681.stgit@notabene.brown> In-Reply-To: <20110517045125.29020.14596.stgit@notabene.brown> References: <20110517045125.29020.14596.stgit@notabene.brown> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 17 May 2011 04:53:20 +0000 (UTC) From: Suresh Jayaraman 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 Signed-off-by: Neil Brown --- utils/nfsd/nfssvc.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) -- 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 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; }