All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: zyjzyj2000@gmail.com, linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next v12 08/11] RDMA/rxe: Stop lookup of partially built objects
Date: Fri, 18 Mar 2022 15:07:37 -0300	[thread overview]
Message-ID: <20220318180737.GX11336@nvidia.com> (raw)
In-Reply-To: <20220318015514.231621-9-rpearsonhpe@gmail.com>

On Thu, Mar 17, 2022 at 08:55:11PM -0500, Bob Pearson wrote:
> diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
> index fc3942e04a1f..8059f31882ae 100644
> +++ b/drivers/infiniband/sw/rxe/rxe_mr.c
> @@ -687,6 +687,7 @@ int rxe_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
>  	if (atomic_read(&mr->num_mw) > 0)
>  		return -EINVAL;
>  
> +	rxe_disable_lookup(mr);
>  	rxe_put(mr);
>  
>  	return 0;

  
> @@ -32,6 +34,7 @@ int rxe_dealloc_mw(struct ib_mw *ibmw)
>  {
>  	struct rxe_mw *mw = to_rmw(ibmw);
>  
> +	rxe_disable_lookup(mw);
>  	rxe_put(mw);
>  
>  	return 0;

> @@ -487,6 +491,7 @@ static int rxe_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata)
>  	struct rxe_qp *qp = to_rqp(ibqp);
>  	int ret;
>  
> +	rxe_disable_lookup(qp);
>  	ret = rxe_qp_chk_destroy(qp);
>  	if (ret)
>  		return ret;

All the places doing 'rxe_disable_lookup' immediately follow it by
rxe_put(), except this one. This one is buggy and should be ordered
after.

If all places do rxe_disable_lookp()/rxe_put() then I'm back to what I
said earlier, this should just be a function that does xa_erase and
forget about 'disable'

Putting the xa_erase in the kref release is a mistake.

Jason

  reply	other threads:[~2022-03-18 18:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18  1:55 [PATCH for-next v12 00/11] Fix race conditions in rxe_pool Bob Pearson
2022-03-18  1:55 ` [PATCH for-next v12 01/11] RDMA/rxe: Replace #define by enum Bob Pearson
2022-03-18 18:00   ` Jason Gunthorpe
2022-03-18  1:55 ` [PATCH for-next v12 02/11] RDMA/rxe: Add rxe_srq_cleanup() Bob Pearson
2022-03-18  1:55 ` [PATCH for-next v12 03/11] RDMA/rxe: Check rxe_get() return value Bob Pearson
2022-03-18  1:55 ` [PATCH for-next v12 04/11] RDMA/rxe: Move qp cleanup code to rxe_qp_do_cleanup() Bob Pearson
2022-03-18  1:55 ` [PATCH for-next v12 05/11] RDMA/rxe: Move mr cleanup code to rxe_mr_cleanup() Bob Pearson
2022-03-18  1:55 ` [PATCH for-next v12 06/11] RDMA/rxe: Move mw cleanup code to rxe_mw_cleanup() Bob Pearson
2022-03-18  1:55 ` [PATCH for-next v12 07/11] RDMA/rxe: Enforce IBA C11-17 Bob Pearson
2022-03-18  1:55 ` [PATCH for-next v12 08/11] RDMA/rxe: Stop lookup of partially built objects Bob Pearson
2022-03-18 18:07   ` Jason Gunthorpe [this message]
2022-03-18  1:55 ` [PATCH for-next v12 09/11] RDMA/rxe: Add wait_for_completion to pool objects Bob Pearson
2022-03-18 18:10   ` Jason Gunthorpe
2022-03-18  1:55 ` [PATCH for-next v12 10/11] RDMA/rxe: Convert read side locking to rcu Bob Pearson
2022-03-18  1:55 ` [PATCH for-next v12 11/11] RDMA/rxe: Cleanup rxe_pool.c Bob Pearson

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=20220318180737.GX11336@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearsonhpe@gmail.com \
    --cc=zyjzyj2000@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.