From patchwork Fri Mar 10 16:07:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 9617723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 20C8860415 for ; Fri, 10 Mar 2017 16:07:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03EAF286F7 for ; Fri, 10 Mar 2017 16:07:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECE3F28721; Fri, 10 Mar 2017 16:07:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71EC8286F7 for ; Fri, 10 Mar 2017 16:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932724AbdCJQHW (ORCPT ); Fri, 10 Mar 2017 11:07:22 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:35000 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933160AbdCJQHU (ORCPT ); Fri, 10 Mar 2017 11:07:20 -0500 Received: by mail-it0-f67.google.com with SMTP id f203so1729832itf.2; Fri, 10 Mar 2017 08:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=kvC3nP/nat7/n8RPh5ICUiG3kQylZix0wLCutXamvmg=; b=CM6Cx/CAmxpddVZ0CCUZBoU0HR+vROFFLHTxkmXhw/g9NIGFJJkQu4bUTfZZy8vQkx Mwb8JCv5mcievbt+Yf0kr4UETVeS0jUgC33C9K9myFwiEpXJEnywVqdKfmJBxGLlAD4G OfDE+mjPAFTf+0IUFFwwTXUDdqT/ix1FFTJmYQVIT+SN/FC1J1XZDXsNnMJ70oi+mQk1 lOhQh5JKPwaJnzCbwvRL88TAELFRM3PdT0PwZEV3TcvQC4F7b5pSnU8Wbe6+6dqozYNH KKLXHus+YG4gvSpYxEFJ8tDHLaW3anKyPC3aHSIrzwe/m2BiNI5exBIJAhGU96JJplT3 bxjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=kvC3nP/nat7/n8RPh5ICUiG3kQylZix0wLCutXamvmg=; b=ndSTLWXrn2hMbSeqHgEIy1BenAEGKCW5cIsZpwjku9fsf5JTWU9Pd7RNacFa+Neo0D p1BOWiOxgTUFWMBGWyfFU5pt/HjbpxexTJLS177N5TANK/AwaO8y/SyXCtgH2M97TFK2 4kIxgHcCr5S+0CxK+Zu3j2sU4Oup2ofVAtleoqk+oWbog8/9bJcFM7tXB2LUaSGXcwsP VdrInQSKjDZX1exUOse/m62kwP8d/ns2yJMLsy0igBJV07HAb4ArVI44gX1UxPy/UoFU awxAjJa416/Xl53Uznymp9sBq60GCuhs+XFPXNqDpa8B12mVTqUsteAlO9vVf4z3Q8La cvgg== X-Gm-Message-State: AFeK/H3DQ3HO08ymY3vZ/z2F0EOo5EJHj+b2fzwRnydsyGwyvaWQzdgFuDlbkJT3lMem7Q== X-Received: by 10.36.50.138 with SMTP id j132mr2844754ita.102.1489162038975; Fri, 10 Mar 2017 08:07:18 -0800 (PST) Received: from manet.1015granger.net ([2604:8800:100:81fc:ec4:7aff:fe6c:1dce]) by smtp.gmail.com with ESMTPSA id a128sm1128092itg.22.2017.03.10.08.07.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Mar 2017 08:07:18 -0800 (PST) Subject: [PATCH v1 11/11] xprtrdma: Revert commit d0f36c46deea From: Chuck Lever To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Fri, 10 Mar 2017 11:07:18 -0500 Message-ID: <20170310160717.6314.12909.stgit@manet.1015granger.net> In-Reply-To: <20170310154131.6314.35201.stgit@manet.1015granger.net> References: <20170310154131.6314.35201.stgit@manet.1015granger.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Device removal is now adequately supported. Pinning the underlying device driver to prevent removal while an NFS mount is active is no longer necessary. Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/verbs.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 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/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index ef3ceec..41f00c9 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -53,7 +53,7 @@ #include #include #include -#include /* try_module_get()/module_put() */ + #include #include "xprt_rdma.h" @@ -344,14 +344,6 @@ return 0; } -static void rpcrdma_destroy_id(struct rdma_cm_id *id) -{ - if (id) { - module_put(id->device->owner); - rdma_destroy_id(id); - } -} - static struct rdma_cm_id * rpcrdma_create_id(struct rpcrdma_xprt *xprt, struct rpcrdma_ia *ia, struct sockaddr *addr) @@ -386,16 +378,6 @@ static void rpcrdma_destroy_id(struct rdma_cm_id *id) goto out; } - /* FIXME: - * Until xprtrdma supports DEVICE_REMOVAL, the provider must - * be pinned while there are active NFS/RDMA mounts to prevent - * hangs and crashes at umount time. - */ - if (!ia->ri_async_rc && !try_module_get(id->device->owner)) { - dprintk("RPC: %s: Failed to get device module\n", - __func__); - ia->ri_async_rc = -ENODEV; - } rc = ia->ri_async_rc; if (rc) goto out; @@ -405,21 +387,20 @@ static void rpcrdma_destroy_id(struct rdma_cm_id *id) if (rc) { dprintk("RPC: %s: rdma_resolve_route() failed %i\n", __func__, rc); - goto put; + goto out; } rc = wait_for_completion_interruptible_timeout(&ia->ri_done, wtimeout); if (rc < 0) { dprintk("RPC: %s: wait() exited: %i\n", __func__, rc); - goto put; + goto out; } rc = ia->ri_async_rc; if (rc) - goto put; + goto out; return id; -put: - module_put(id->device->owner); + out: rdma_destroy_id(id); return ERR_PTR(rc); @@ -546,7 +527,7 @@ static void rpcrdma_destroy_id(struct rdma_cm_id *id) if (ia->ri_id != NULL && !IS_ERR(ia->ri_id)) { if (ia->ri_id->qp) rdma_destroy_qp(ia->ri_id); - rpcrdma_destroy_id(ia->ri_id); + rdma_destroy_id(ia->ri_id); } ia->ri_id = NULL; ia->ri_device = NULL; @@ -799,7 +780,7 @@ static void rpcrdma_destroy_id(struct rdma_cm_id *id) rdma_destroy_qp(old); out_destroy: - rpcrdma_destroy_id(old); + rdma_destroy_id(old); out: return rc; }