[PATCH] nvme-rdma: Fix early queue flags settings

'Christoph Hellwig' hch at lst.de
Wed Sep 21 07:01:32 PDT 2016


On Tue, Sep 20, 2016 at 08:38:52PM -0700, Sagi Grimberg wrote:
>> Maybe this changelog?
>>
>>     nvme-rdma: only clear queue flags after successful connect
>>
>>     Otherwise, nvme_rdma_stop_and_clear_queue() will incorrectly
>>     try to stop/free rdma qps/cm_ids that are already freed.
>
> I can modify the change log, Christoph do you still want a
> comment in the code?

Honestly there more I look into this the less I'm happy with the patch.
queue->flags is an atomic, and as the patch shows we can get
nvme_rdma_init_queue caled on a queue that still has visibility in
other threads  So I think we really should not even do that simple
queue->flags = 0 assignment at all.  We'll need to use clear_bit to
atomically clear anything that might be set, and we need to be careful
where we do that.  I think this whole situation that we can get an
*_init_* function called on something that already is live and visible
to other threads need to be well documented at least because it's just
waiting for sucker like me that don't expect that.



More information about the Linux-nvme mailing list