Re: [PATCH] svcrdma: Unregister the device if svc_rdma_accept() fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/28/25 2:10 AM, Zhu Yanjun wrote:
> 在 2025/4/27 18:39, cel@xxxxxxxxxx 写道:
>> From: Chuck Lever <chuck.lever@xxxxxxxxxx>
>>
>> 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@xxxxxxxxx>

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@xxxxxxxxxxxxxxx
>> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
>> ---
>>   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




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux