Commit ad103e79 authored by Keith Busch's avatar Keith Busch Committed by Jens Axboe

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: default avatarKeith Busch <keith.busch@intel.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 01fc27d9
...@@ -697,8 +697,8 @@ void blk_mq_start_request(struct request *rq) ...@@ -697,8 +697,8 @@ void blk_mq_start_request(struct request *rq)
preempt_disable(); preempt_disable();
write_seqcount_begin(&rq->gstate_seq); write_seqcount_begin(&rq->gstate_seq);
blk_mq_rq_update_state(rq, MQ_RQ_IN_FLIGHT);
blk_add_timer(rq); blk_add_timer(rq);
blk_mq_rq_update_state(rq, MQ_RQ_IN_FLIGHT);
write_seqcount_end(&rq->gstate_seq); write_seqcount_end(&rq->gstate_seq);
preempt_enable(); preempt_enable();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment