blk-mq: mark flush request as IDLE in flush_end_io()

Mark flush request as IDLE in its .end_io(), aligning it with how normal
requests behave. The flush request stays in in-flight tags if we're not
using an IO scheduler, so we need to change its state into IDLE.
Otherwise, we will hang in blk_mq_tagset_wait_completed_request() during
error recovery because flush the request state is kept as COMPLETED.

Reported-by: Yi Zhang <>
Signed-off-by: Ming Lei <>
Tested-by: Yi Zhang <>
Cc: Chao Leng <>
Cc: Sagi Grimberg <>
Signed-off-by: Jens Axboe <>
1 file changed