[ofa-general] Re: [PATCH 1 of 2] libmlx4: Fix race condition in create/destroy QP
Jack Morgenstein
jackm at dev.mellanox.co.il
Mon Nov 24 22:36:45 PST 2008
On Monday 24 November 2008 23:52, Roland Dreier wrote:
> I think I see one bug at least:
>
> > @@ -580,9 +584,12 @@ int mlx4_destroy_qp(struct ibv_qp *ibqp)
> > struct mlx4_qp *qp = to_mqp(ibqp);
> > int ret;
> >
> > + pthread_mutex_lock(&to_mctx(ibqp->context)->qp_table_mutex);
> > ret = ibv_cmd_destroy_qp(ibqp);
> > - if (ret)
> > + if (ret) {
> > + pthread_mutex_lock(&to_mctx(ibqp->context)->qp_table_mutex);
>
> The second one should be unlock.
>
> I'm too tired to check everything carefully enough to be sure it's right
> though. Can you double-check your lock balancing and error paths, and
> resend fixed patches?
>
> Thanks,
> Roland
Ouch! that is the only bug (after my careful review).
I guess I was tired when I sent them.
I'm resending this patch (fixed) only -- the libmthca patch is OK.
- Jack
More information about the general
mailing list