Linux-NFS Archive on lore.kernel.org
 help / Atom feed
* [PATCH 1/2] xprtrdma: Fix error code in rpcrdma_buffer_create()
@ 2019-01-05 13:06 Dan Carpenter
  2019-01-05 16:17 ` Chuck Lever
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-01-05 13:06 UTC (permalink / raw)
  To: Trond Myklebust, Chuck Lever
  Cc: Jeff Layton, Trond Myklebust, Anna Schumaker, linux-nfs, kernel-janitors

This should return -ENOMEM if __alloc_workqueue_key() fails, but it
returns success.

Fixes: 6d2d0ee27c7a ("xprtrdma: Replace rpcrdma_receive_wq with a per-xprt workqueue")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 net/sunrpc/xprtrdma/verbs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 7749a2bf6887..3dde05892c8e 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1113,8 +1113,10 @@ rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt)
 						WQ_MEM_RECLAIM | WQ_HIGHPRI,
 						0,
 			r_xprt->rx_xprt.address_strings[RPC_DISPLAY_ADDR]);
-	if (!buf->rb_completion_wq)
+	if (!buf->rb_completion_wq) {
+		rc = -ENOMEM;
 		goto out;
+	}
 
 	return 0;
 out:
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] xprtrdma: Fix error code in rpcrdma_buffer_create()
  2019-01-05 13:06 [PATCH 1/2] xprtrdma: Fix error code in rpcrdma_buffer_create() Dan Carpenter
@ 2019-01-05 16:17 ` Chuck Lever
  0 siblings, 0 replies; 2+ messages in thread
From: Chuck Lever @ 2019-01-05 16:17 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Trond Myklebust, Jeff Layton, Anna Schumaker,
	Linux NFS Mailing List, kernel-janitors


> On Jan 5, 2019, at 8:06 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> This should return -ENOMEM if __alloc_workqueue_key() fails, but it
> returns success.
> 
> Fixes: 6d2d0ee27c7a ("xprtrdma: Replace rpcrdma_receive_wq with a per-xprt workqueue")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Indeed.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>


> ---
> net/sunrpc/xprtrdma/verbs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index 7749a2bf6887..3dde05892c8e 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -1113,8 +1113,10 @@ rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt)
> 						WQ_MEM_RECLAIM | WQ_HIGHPRI,
> 						0,
> 			r_xprt->rx_xprt.address_strings[RPC_DISPLAY_ADDR]);
> -	if (!buf->rb_completion_wq)
> +	if (!buf->rb_completion_wq) {
> +		rc = -ENOMEM;
> 		goto out;
> +	}
> 
> 	return 0;
> out:
> -- 
> 2.17.1
> 

--
Chuck Lever




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-05 13:06 [PATCH 1/2] xprtrdma: Fix error code in rpcrdma_buffer_create() Dan Carpenter
2019-01-05 16:17 ` Chuck Lever

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org linux-nfs@archiver.kernel.org
	public-inbox-index linux-nfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox