From patchwork Mon May 11 18:02:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 6379831 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EF4BD9F399 for ; Mon, 11 May 2015 18:02:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1AC8720953 for ; Mon, 11 May 2015 18:02:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0EFC620951 for ; Mon, 11 May 2015 18:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753493AbbEKSCm (ORCPT ); Mon, 11 May 2015 14:02:42 -0400 Received: from mail-qc0-f173.google.com ([209.85.216.173]:34809 "EHLO mail-qc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552AbbEKSCi (ORCPT ); Mon, 11 May 2015 14:02:38 -0400 Received: by qcyk17 with SMTP id k17so73261624qcy.1; Mon, 11 May 2015 11:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=Gj/5gc406nrBXVKvMX6ZFESu1yc14PY6XdWXLysNfwk=; b=l7pdZP9in5CYKfTUn/8LHyqNuD1WECuKwnSrSXrGApH3tGYJQzOAoyfW2LeKvSg//k KI3ueAD1I+ku1k8LMOoK4R4KRBpzD0ivEbhl0xewuDJbfYQoy0mDwsfOmeRj+NREbwiH Aaz6+ZDoPOQPh+ySG2ciBm8Zijb4tWMLEkTyKwLnolh9EgP4VKRSJL5no/Nbc7ASiqE5 1UJmSfcLKCAuS83r3Kum1ck+0x0TMco+Bw7WLtNMHWtfce9bTBuUju5I6nCdM7nb83Tm urXwZJuVsgZii7J73TqrLEEtwX/KtLU/QNkW2PjtkeKKyYb27qk0Afz+fkfGaz/4J0zo aCSQ== X-Received: by 10.55.53.8 with SMTP id c8mr24580185qka.63.1431367357988; Mon, 11 May 2015 11:02:37 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:82ee:73ff:fe43:d64f]) by mx.google.com with ESMTPSA id 102sm11214994qgn.37.2015.05.11.11.02.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 11:02:36 -0700 (PDT) Subject: [PATCH v2 02/16] xprtrdma: Warn when there are orphaned IB objects From: Chuck Lever To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Mon, 11 May 2015 14:02:35 -0400 Message-ID: <20150511180235.31263.71754.stgit@manet.1015granger.net> In-Reply-To: <20150511174401.31263.79596.stgit@manet.1015granger.net> References: <20150511174401.31263.79596.stgit@manet.1015granger.net> User-Agent: StGit/0.17.1-3-g7d0f MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP WARN during transport destruction if ib_dealloc_pd() fails. This is a sign that xprtrdma orphaned one or more RDMA API objects at some point, which can pin lower layer kernel modules and cause shutdown to hang. Signed-off-by: Chuck Lever Reviewed-by: Steve Wise Reviewed-by: Sagi Grimberg Reviewed-by: Devesh Sharma --- net/sunrpc/xprtrdma/verbs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 4870d27..51900e6 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -702,17 +702,17 @@ rpcrdma_ia_close(struct rpcrdma_ia *ia) dprintk("RPC: %s: ib_dereg_mr returned %i\n", __func__, rc); } + if (ia->ri_id != NULL && !IS_ERR(ia->ri_id)) { if (ia->ri_id->qp) rdma_destroy_qp(ia->ri_id); rdma_destroy_id(ia->ri_id); ia->ri_id = NULL; } - if (ia->ri_pd != NULL && !IS_ERR(ia->ri_pd)) { - rc = ib_dealloc_pd(ia->ri_pd); - dprintk("RPC: %s: ib_dealloc_pd returned %i\n", - __func__, rc); - } + + /* If the pd is still busy, xprtrdma missed freeing a resource */ + if (ia->ri_pd && !IS_ERR(ia->ri_pd)) + WARN_ON(ib_dealloc_pd(ia->ri_pd)); } /*