[PATCH WIP/RFC v3 3/6] nvme_rdma: keep a ref on the ctrl during delete/flush

Steve Wise swise at opengridcomputing.com
Tue Aug 30 10:48:06 PDT 2016


> 
> 
> > -	/* Queue controller deletion */
> > +	/*
> > +	 * Queue controller deletion. Keep a reference until all
> > +	 * work is flushed since delete_work will free the ctrl mem
> > +	 */
> > +	kref_get(&ctrl->ctrl.kref);
> 
> kref_get_unless_zero?
> 

At the top of nvme_rdma_device_unplug(), we change the ctrl state to DELETING.
If that succeeded, and thus we own the delete process, and are about to kref the
controller, how could the controller ref be 0?  If it is, it is probably freed
which means we're in a bad way...





More information about the Linux-nvme mailing list