[PATCH] nvme-rdma: fix possible hang when issuing commands during ctrl removal

Sagi Grimberg sagi at grimberg.me
Mon Oct 23 02:04:18 PDT 2017


>>   			/*
>> +			 * deleting state means that the ctrl will never accept
>> +			 * commands again, fail it permanently.
>> +			 */
>> +			if (queue->ctrl->ctrl.state == NVME_CTRL_DELETING) {
>> +				nvme_req(rq)->status = NVME_SC_ABORT_REQ;
>> +				return BLK_STS_IOERR;
> 
> What does the NVME_SC_ABORT_REQ buy us here compared to just returning
> BLK_STS_IOERR as in the reconnecting case?

reg_write32() issues a sync command, which returns
nvme_req(req)->status (blk_execute_request error detection is caller
specific). without it nvme_shutdown_ctrl thinks reg_write32() succeeded
and polls with reg_read32() for no good reason.

And its needed for the reconnecting case too, we just never noticed
it for that case.

> Why can't we just merge the two cases?

Because we fail for slightly different reasons so I thought two
distinct conditionals looks cleaner, but we can merge the two.



More information about the Linux-nvme mailing list