Re: [PATCH 1/2] block: export __blk_complete_request
From: jianchao.wang
Date: Thu Jun 14 2018 - 23:04:13 EST
Hi Ming
Thanks for your kindly response.
On 06/15/2018 10:56 AM, Ming Lei wrote:
>>> IMO, ref-counter is just to fix the blk-mq req life recycle issue.
>>> It cannot replace the blk_mark_rq_complete which could avoid the race between
>>> timeout and io completion path.
>> The .timeout return BLK_EH_DONE doesn't always mean the request has been completed.
>> Such as scsi-mid layer, its .timeout callback return BLK_EH_DONE but the timed out
>> request is still in abort or eh process. What if a completion irq come during that ?
> For blk-mq, it is avoided by the atomic state change in
> __blk_mq_complete_request(),
> that is why I mentioned the question in my last reply.
>
but blk_mq_check_expired doesn't do that.
do I miss anything ?
> But what if the timed-out request has been freed by EH? Then seems
> req's ref_counter
Thanks
Jianchao