From: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: [PATCH v1 11/11] xprtrdma: Revert commit d0f36c46deea Date: Fri, 10 Mar 2017 11:07:18 -0500 [thread overview] Message-ID: <20170310160717.6314.12909.stgit@manet.1015granger.net> (raw) In-Reply-To: <20170310154131.6314.35201.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org> 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 <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> --- net/sunrpc/xprtrdma/verbs.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) 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 <linux/sunrpc/addr.h> #include <linux/sunrpc/svc_rdma.h> #include <asm/bitops.h> -#include <linux/module.h> /* try_module_get()/module_put() */ + #include <rdma/ib_cm.h> #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; } -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Chuck Lever <chuck.lever@oracle.com> To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH v1 11/11] xprtrdma: Revert commit d0f36c46deea Date: Fri, 10 Mar 2017 11:07:18 -0500 [thread overview] Message-ID: <20170310160717.6314.12909.stgit@manet.1015granger.net> (raw) In-Reply-To: <20170310154131.6314.35201.stgit@manet.1015granger.net> 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 <chuck.lever@oracle.com> --- net/sunrpc/xprtrdma/verbs.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) 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 <linux/sunrpc/addr.h> #include <linux/sunrpc/svc_rdma.h> #include <asm/bitops.h> -#include <linux/module.h> /* try_module_get()/module_put() */ + #include <rdma/ib_cm.h> #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; }
next prev parent reply other threads:[~2017-03-10 16:07 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-03-10 16:05 [PATCH v1 00/11] [RFC] NFS/RDMA client-side patches for 4.12 Chuck Lever 2017-03-10 16:05 ` Chuck Lever [not found] ` <20170310154131.6314.35201.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org> 2017-03-10 16:05 ` [PATCH v1 01/11] xprtrdma: Annotate receive workqueue Chuck Lever 2017-03-10 16:05 ` Chuck Lever 2017-03-10 16:06 ` [PATCH v1 02/11] xprtrdma: Cancel refresh worker during buffer shutdown Chuck Lever 2017-03-10 16:06 ` Chuck Lever 2017-03-10 16:06 ` [PATCH v1 03/11] xprtrdma: Clean up rpcrdma_marshal_req() Chuck Lever 2017-03-10 16:06 ` Chuck Lever 2017-03-10 16:06 ` [PATCH v1 04/11] sunrpc: Export xprt_force_disconnect() Chuck Lever 2017-03-10 16:06 ` Chuck Lever 2017-03-10 16:06 ` [PATCH v1 05/11] xprtrdma: Detect unreachable NFS/RDMA servers more reliably Chuck Lever 2017-03-10 16:06 ` Chuck Lever 2017-03-10 16:06 ` [PATCH v1 06/11] xprtrdma: Refactor rpcrdma_ia_open() Chuck Lever 2017-03-10 16:06 ` Chuck Lever 2017-03-10 16:06 ` [PATCH v1 07/11] xprtrdma: Use same device when mapping or syncing DMA buffers Chuck Lever 2017-03-10 16:06 ` Chuck Lever 2017-03-10 16:06 ` [PATCH v1 08/11] xprtrdma: Support unplugging an HCA from under an NFS mount Chuck Lever 2017-03-10 16:06 ` Chuck Lever 2017-03-10 16:07 ` [PATCH v1 09/11] xprtrdma: Refactor rpcrdma_ep_connect Chuck Lever 2017-03-10 16:07 ` Chuck Lever 2017-03-10 16:07 ` [PATCH v1 10/11] xprtrdma: Restore transport after device removal Chuck Lever 2017-03-10 16:07 ` Chuck Lever 2017-03-10 16:07 ` Chuck Lever [this message] 2017-03-10 16:07 ` [PATCH v1 11/11] xprtrdma: Revert commit d0f36c46deea Chuck Lever
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=20170310160717.6314.12909.stgit@manet.1015granger.net \ --to=chuck.lever-qhclzuegtsvqt0dzr+alfa@public.gmane.org \ --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ /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: linkBe 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.