Linux NFS development
 help / color / mirror / Atom feed
From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: cel@kernel.org, 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 08:10:17 +0200	[thread overview]
Message-ID: <6d21d80b-db20-4f00-bff0-147716693baf@linux.dev> (raw)
In-Reply-To: <20250427163959.5126-1-cel@kernel.org>

在 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?

Except that, looks good to me.

Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>

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;


  reply	other threads:[~2025-04-28  6:10 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 [this message]
2025-04-28 18:36   ` 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=6d21d80b-db20-4f00-bff0-147716693baf@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=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 \
    /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