blk-mq: mark flush request as IDLE in flush_end_io()
PATCH 1/1 blk-mq: mark flush request as IDLE in flush_end_io()
Mark flush request as IDLE in its .end_io() for aligning to normal request since flush request stays in in-flight tags in case of !elevator, 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 request's state is kept as COMPLETE.
Cc Chao Leng <[email protected]>
Cc Sagi Grimberg <[email protected]>
Reported-by Yi Zhang <[email protected]>
Tested-by Yi Zhang <[email protected]>
Signed-off-by Ming Lei <[email protected]>
--- block/blk-flush.c | 1 + 1 file changed, 1 insertion(+)
block/blk-flush.c +1 -0
@@ -225,6 +225,7 @@ static void flush_end_io(struct request *flush_rq, blk_status_t error)/* release the tag's ownership to the req cloned from */ spin_lock_irqsave (&fq->mq_flush_lock, flags); +WRITE_ONCE (flush_rq->state,MQ_RQ_IDLE );if (!refcount_dec_and_test (&flush_rq->ref)) { fq->rq_status = error;spin_unlock_irqrestore (&fq->mq_flush_lock, flags);
Signature · 1 line
2.25.2
Quoted 4 lines · Ming Lei
Mark flush request as IDLE in its .end_io() for aligning to normal request since flush request stays in in-flight tags in case of !elevator, 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 request's state is kept as COMPLETE.
Applied, thanks.
Signature · 1 line
Jens Axboe