On Mon, Oct 24, 2011 at 7:33 AM, Nicholas A. Bellinger <n...@linux-iscsi.org> wrote: > @@ -2144,11 +2140,11 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) > goto out; > > ch->cq = ib_create_cq(sdev->device, srpt_completion, NULL, ch, > - ch->rq_size + srpt_sq_size, 0); > + ch->rq_size + sport->port_attrib.srp_sq_size, > 0); > if (IS_ERR(ch->cq)) { > ret = PTR_ERR(ch->cq); > printk(KERN_ERR "failed to create CQ cqe= %d ret= %d\n", > - ch->rq_size + srpt_sq_size, ret); > + ch->rq_size + sport->port_attrib.srp_sq_size, ret); > goto out; > } > > @@ -2160,7 +2156,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) > qp_init->srq = sdev->srq; > qp_init->sq_sig_type = IB_SIGNAL_REQ_WR; > qp_init->qp_type = IB_QPT_RC; > - qp_init->cap.max_send_wr = srpt_sq_size; > + qp_init->cap.max_send_wr = sport->port_attrib.srp_sq_size; > qp_init->cap.max_send_sge = SRPT_DEF_SG_PER_WQE;
This patch introduces a race condition: if sport->port_attrib.srp_sq_size is modified from user space while an SRP login is ongoing then different values of that parameter can be used in each of the above statements that read that parameter while they all should use the same value. Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html