[ofa-general] Re: [PATCH 1 of 2] libmlx4: Fix race condition in create/destroy QP
Roland Dreier
rdreier at cisco.com
Mon Nov 24 13:52:55 PST 2008
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
More information about the general
mailing list