From: Tom Tucker <tom@opengridcomputing.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 7/17] svcrdma: Fix error handling during listening endpoint creation
Date: Tue, 06 May 2008 09:48:06 -0500 [thread overview]
Message-ID: <C445D9D6.4AB49%tom@opengridcomputing.com> (raw)
In-Reply-To: <20080505224140.GI12814@fieldses.org>
On 5/5/08 5:41 PM, "J. Bruce Fields" <bfields@fieldses.org> wrote:
> On Fri, May 02, 2008 at 11:28:39AM -0500, Tom Tucker wrote:
>> A listening endpoint isn't known to the generic transport switch until
>> the svc_create_xprt function returns without error. Calling
>> svc_xprt_put within the xpo_create function causes the module reference
>> count to be erroneously decremented.
>
> There's some redundant code in these three error paths; would the usual
> kernel-style "goto cleanup" thing help?
I think code-size it's a wash, but it might look more familiar. BTW, I
noticed that the error path above returns a positive errno :-\, so that
needs to be fixed too.
>
> --b.
>
>>
>> Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
>>
>> ---
>> net/sunrpc/xprtrdma/svc_rdma_transport.c | 6 +++---
>> 1 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> b/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> index 83818cf..0d9a828 100644
>> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> @@ -669,7 +669,7 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv
>> *serv,
>>
>> listen_id = rdma_create_id(rdma_listen_handler, cma_xprt, RDMA_PS_TCP);
>> if (IS_ERR(listen_id)) {
>> - svc_xprt_put(&cma_xprt->sc_xprt);
>> + kfree(cma_xprt);
>> dprintk("svcrdma: rdma_create_id failed = %ld\n",
>> PTR_ERR(listen_id));
>> return (void *)listen_id;
>> @@ -677,7 +677,7 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv
>> *serv,
>> ret = rdma_bind_addr(listen_id, sa);
>> if (ret) {
>> rdma_destroy_id(listen_id);
>> - svc_xprt_put(&cma_xprt->sc_xprt);
>> + kfree(cma_xprt);
>> dprintk("svcrdma: rdma_bind_addr failed = %d\n", ret);
>> return ERR_PTR(ret);
>> }
>> @@ -686,7 +686,7 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv
>> *serv,
>> ret = rdma_listen(listen_id, RPCRDMA_LISTEN_BACKLOG);
>> if (ret) {
>> rdma_destroy_id(listen_id);
>> - svc_xprt_put(&cma_xprt->sc_xprt);
>> + kfree(cma_xprt);
>> dprintk("svcrdma: rdma_listen failed = %d\n", ret);
>> return ERR_PTR(ret);
>> }
> --
> 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
next prev parent reply other threads:[~2008-05-06 14:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1209745721600-git-send-email-tom@opengridcomputing.com>
2008-05-02 22:37 ` [PATCH 0/17] svcrdma: RDMA transport driver close path cleanup J. Bruce Fields
2008-05-02 23:05 ` Tom Tucker
[not found] ` <12097457211326-git-send-email-tom@opengridcomputing.com>
[not found] ` <1209745721248-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457213375-git-send-email-tom@opengridcomputing.com>
2008-05-05 19:31 ` [PATCH 1/17] svcrdma: Simplify receive buffer posting J. Bruce Fields
[not found] ` <12097457212336-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457212951-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457211122-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457223433-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457223971-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457223635-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457223351-git-send-email-tom@opengridcomputing.com>
2008-05-05 22:06 ` [PATCH 2/17] svcrdma: Fix race with dto_tasklet in svc_rdma_send J. Bruce Fields
2008-05-06 2:26 ` Tom Tucker
2008-05-06 21:18 ` J. Bruce Fields
2008-05-07 0:45 ` Tom Tucker
[not found] ` <12097457221640-git-send-email-tom@opengridcomputing.com>
2008-05-05 22:08 ` [PATCH 3/17] svcrdma: Fix return value " J. Bruce Fields
2008-05-06 2:03 ` Tom Tucker
2008-05-06 21:08 ` J. Bruce Fields
[not found] ` <120974572253-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457223519-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457223927-git-send-email-tom@opengridcomputing.com>
[not found] ` <12097457232986-git-send-email-tom@opengridcomputing.com>
2008-05-05 22:41 ` [PATCH 7/17] svcrdma: Fix error handling during listening endpoint creation J. Bruce Fields
2008-05-06 14:48 ` Tom Tucker [this message]
2008-05-06 21:22 ` J. Bruce Fields
2008-05-07 0:48 ` Tom Tucker
2008-05-07 1:30 ` J. Bruce Fields
[not found] ` <12097457231736-git-send-email-tom@opengridcomputing.com>
2008-05-05 22:52 ` [PATCH 8/17] svcrdma: Return error from rdma_read_xdr so caller knows to free context J. Bruce Fields
2008-05-06 2:05 ` Tom Tucker
2008-05-06 21:32 ` [PATCH 11/17] svcrdma: Use standard Linux lists for context cache J. Bruce Fields
2008-05-07 0:49 ` Tom Tucker
2008-05-06 21:46 ` [PATCH 0/17] svcrdma: RDMA transport driver close path cleanup J. Bruce Fields
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=C445D9D6.4AB49%tom@opengridcomputing.com \
--to=tom@opengridcomputing.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox