blk-mq: mark flush request as IDLE in flush_end_io()
authorMing Lei <ming.lei@redhat.com>
Fri, 30 Oct 2020 02:42:53 +0000 (10:42 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 30 Oct 2020 14:33:49 +0000 (08:33 -0600)
commit65ff5cd04551daf2c11c7928e48fc3483391c900
tree93d6db0e0473214a2837b0099771ca6bed8725c1
parent1f41be7d4e90e36084037cecba5978b3d7f849db
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 <yi.zhang@redhat.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Cc: Chao Leng <lengchao@huawei.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-flush.c