Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: Zhu Yanjun <yanjun.zhu@linux.dev>, NeilBrown <neil@brown.name>,
	Jeff Layton <jlayton@kernel.org>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org,
	Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH] svcrdma: Unregister the device if svc_rdma_accept() fails
Date: Mon, 28 Apr 2025 14:36:15 -0400	[thread overview]
Message-ID: <abb0f9c9-796b-4d4e-9df4-37908fd9a00b@kernel.org> (raw)
In-Reply-To: <6d21d80b-db20-4f00-bff0-147716693baf@linux.dev>

On 4/28/25 2:10 AM, Zhu Yanjun wrote:
> 在 2025/4/27 18:39, cel@kernel.org 写道:
>> From: Chuck Lever <chuck.lever@oracle.com>
>>
>> To handle device removal, svc_rdma_accept() registers an interest in
>                                                            ^^^^^^^^
> interface?

I did indeed mean "interest" (as in, "I'm interested in notification")
but I agree, it's awkward phrasing. I rewrote it.


> Except that, looks good to me.
> 
> Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>

Thanks!


> Zhu Yanjun
> 
>> the underlying device when accepting a connection. However
>> svc_rdma_free() is not invoked if svc_rdma_accept() fails. There
>> needs to be a matching "unregister" in that case; otherwise the
>> device cannot be removed.
>>
>> Fixes: c4de97f7c454 ("svcrdma: Handle device removal outside of the CM
>> event handler")
>> X-Cc: stable@vger.kernel.org
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>>   net/sunrpc/xprtrdma/svc_rdma_transport.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/
>> xprtrdma/svc_rdma_transport.c
>> index aca8bdf65d72..5940a56023d1 100644
>> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
>> @@ -575,6 +575,7 @@ static struct svc_xprt *svc_rdma_accept(struct
>> svc_xprt *xprt)
>>       if (newxprt->sc_qp && !IS_ERR(newxprt->sc_qp))
>>           ib_destroy_qp(newxprt->sc_qp);
>>       rdma_destroy_id(newxprt->sc_cm_id);
>> +    rpcrdma_rn_unregister(dev, &newxprt->sc_rn);
>>       /* This call to put will destroy the transport */
>>       svc_xprt_put(&newxprt->sc_xprt);
>>       return NULL;
> 


-- 
Chuck Lever

      reply	other threads:[~2025-04-28 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-27 16:39 [PATCH] svcrdma: Unregister the device if svc_rdma_accept() fails cel
2025-04-28  6:10 ` Zhu Yanjun
2025-04-28 18:36   ` Chuck Lever [this message]

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=abb0f9c9-796b-4d4e-9df4-37908fd9a00b@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=yanjun.zhu@linux.dev \
    /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