From patchwork Thu Feb 27 21:16:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11410897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E7521580 for ; Thu, 27 Feb 2020 21:50:12 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76D9D246A1 for ; Thu, 27 Feb 2020 21:50:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76D9D246A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id A9EF4348B64; Thu, 27 Feb 2020 13:41:24 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 178E6348851 for ; Thu, 27 Feb 2020 13:20:54 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 2B31E918D; Thu, 27 Feb 2020 16:18:19 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 2971047C; Thu, 27 Feb 2020 16:18:19 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:16:09 -0500 Message-Id: <1582838290-17243-502-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 501/622] lnet: o2ib: Record rc in debug log on startup failure X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Chris Horn Since kiblnd_startup() return -ENETDOWN on failure, let's record the rc value for the failure case in the debug log. Cray-bug-id: LUS-7935 WC-bug-id: https://jira.whamcloud.com/browse/LU-12824 Lustre-commit: 99f85541a685 ("LU-12824 o2ib: Record rc in debug log on startup failure") Signed-off-by: Chris Horn Reviewed-on: https://review.whamcloud.com/36325 Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- net/lnet/klnds/o2iblnd/o2iblnd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/net/lnet/klnds/o2iblnd/o2iblnd.c b/net/lnet/klnds/o2iblnd/o2iblnd.c index d4d5d4f..d162b0a7 100644 --- a/net/lnet/klnds/o2iblnd/o2iblnd.c +++ b/net/lnet/klnds/o2iblnd/o2iblnd.c @@ -2848,10 +2848,10 @@ static int kiblnd_dev_start_threads(struct kib_dev *dev, u32 *cpts, int ncpts) static int kiblnd_startup(struct lnet_ni *ni) { - char *ifname; + char *ifname = NULL; struct lnet_inetdev *ifaces = NULL; struct kib_dev *ibdev = NULL; - struct kib_net *net; + struct kib_net *net = NULL; unsigned long flags; int rc; int i; @@ -2866,8 +2866,10 @@ static int kiblnd_startup(struct lnet_ni *ni) net = kzalloc(sizeof(*net), GFP_NOFS); ni->ni_data = net; - if (!net) + if (!net) { + rc = -ENOMEM; goto net_failed; + } net->ibn_incarnation = ktime_get_real_ns() / NSEC_PER_USEC; @@ -2884,6 +2886,7 @@ static int kiblnd_startup(struct lnet_ni *ni) if (ni->ni_interfaces[1]) { CERROR("ko2iblnd: Multiple interfaces not supported\n"); + rc = -EINVAL; goto failed; } @@ -2894,6 +2897,7 @@ static int kiblnd_startup(struct lnet_ni *ni) if (strlen(ifname) >= sizeof(ibdev->ibd_ifname)) { CERROR("IPoIB interface name too long: %s\n", ifname); + rc = -E2BIG; goto failed; } @@ -2968,7 +2972,9 @@ static int kiblnd_startup(struct lnet_ni *ni) net_failed: kiblnd_shutdown(ni); - CDEBUG(D_NET, "%s failed\n", __func__); + CDEBUG(D_NET, "Configuration of device %s failed: rc = %d\n", + ifname ? ifname : "", rc); + return -ENETDOWN; }