Re: [PATCH for-next 04/10] RDMA/hns: Add SRQ asynchronous event support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 22, 2018 at 11:13:46AM -0700, Jason Gunthorpe wrote:
> On Sat, Oct 27, 2018 at 03:15:18PM +0800, Lijun Ou wrote:
> > +void hns_roce_srq_event(struct hns_roce_dev *hr_dev, u32 srqn, int event_type)
> > +{
> > +	struct hns_roce_srq_table *srq_table = &hr_dev->srq_table;
> > +	struct hns_roce_srq *srq;
> > +
> > +	rcu_read_lock();
> > +	srq = radix_tree_lookup(&srq_table->tree,
> > +				srqn & (hr_dev->caps.num_srqs - 1));
> > +	rcu_read_unlock();
> > +	if (srq) {
> > +		refcount_inc(&srq->refcount);
>
> This doesn't look right to me..
>
> The refcount_inc should be inside the RCU and it should almost
> certainly be refcount_inc_not_zero.

Are you sure that you can update the variable inside of struct which is
protected by RCU?

Thanks

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux