[PATCH 2/5] nvme: Ending failed unstarted requests

jianchao.wang jianchao.w.wang at oracle.com
Tue Jan 23 05:09:10 PST 2018


Hi Sagi


On 01/23/2018 09:02 PM, Sagi Grimberg wrote:
> 
>>> +static void nvme_end_unstarted_request(struct request *req, void *data,
>>> +                       bool reserved)
>>> +{
>>> +    if (blk_mq_request_started(req))
>>> +        return;
>>> +
>>> +    dev_dbg_ratelimited(((struct nvme_ctrl *) data)->device,
>>> +                "Ending I/O %d", req->tag);
>>> +    blk_mq_end_request(req, BLK_STS_IOERR);
>>> +}
>>> +
>>
>> This unstarted requests have not been dequeued from the blk-mq queue.
>> We cannot end them directly.
> 
> I think we cannot complete them. I think its fine to end them.
> 
The end here which is done by blk_mq_end_request is to free it,

blk_mq_end_request()
  -> __blk_mq_end_request()
    -> blk_mq_free_request()

The requests are still on the blk-mq queues.
How can we free them ?

Thanks
Jianchao



More information about the Linux-nvme mailing list