summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2018-05-29 15:52:27 +0200
committerJens Axboe <axboe@kernel.dk>2018-05-29 08:47:40 -0600
commitad103e79838d4b4cd4d6dd0bdfaef937e8652ae9 (patch)
tree3373843f14ffb3bc33eaefa6cedea19baee89b39 /block
parent01fc27d96950149c3e6c0b8dfbe05e26725381cb (diff)
downloadlinux-0-day-ad103e79838d4b4cd4d6dd0bdfaef937e8652ae9.tar.gz
linux-0-day-ad103e79838d4b4cd4d6dd0bdfaef937e8652ae9.tar.xz
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 <keith.busch@intel.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index df928200b17e9..3581a1e5c8a78 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -697,8 +697,8 @@ void blk_mq_start_request(struct request *rq)
preempt_disable();
write_seqcount_begin(&rq->gstate_seq);
- blk_mq_rq_update_state(rq, MQ_RQ_IN_FLIGHT);
blk_add_timer(rq);
+ blk_mq_rq_update_state(rq, MQ_RQ_IN_FLIGHT);
write_seqcount_end(&rq->gstate_seq);
preempt_enable();