Skip to content

Commit ad103e7

Browse files
Keith Buschaxboe
authored andcommitted
blk-mq: Fix timeout and state order
The block layer had been setting the state to in-flight prior to updating the timer. This is the wrong order since the timeout handler could observe the in-flight state with the older timeout, believing the request had expired when in fact it is just getting started. Signed-off-by: Keith Busch <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 01fc27d commit ad103e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/blk-mq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,8 @@ void blk_mq_start_request(struct request *rq)
697697
preempt_disable();
698698
write_seqcount_begin(&rq->gstate_seq);
699699

700-
blk_mq_rq_update_state(rq, MQ_RQ_IN_FLIGHT);
701700
blk_add_timer(rq);
701+
blk_mq_rq_update_state(rq, MQ_RQ_IN_FLIGHT);
702702

703703
write_seqcount_end(&rq->gstate_seq);
704704
preempt_enable();

0 commit comments

Comments
 (0)