提交 538b7534 编写于 作者: J Jens Axboe

blk-mq: request deadline must be visible before marking rq as started

When we start the request, we set the deadline and flip the bits
marking the request as started and non-complete. However, it's
important that the deadline store is ordered before flipping the
bits, otherwise we could have a small window where the request is
marked started but with an invalid deadline. This can confuse the
timeout handling.
Suggested-by: NMing Lei <tom.leiming@gmail.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 37504a3b
...@@ -392,6 +392,12 @@ static void blk_mq_start_request(struct request *rq, bool last) ...@@ -392,6 +392,12 @@ static void blk_mq_start_request(struct request *rq, bool last)
blk_add_timer(rq); blk_add_timer(rq);
/*
* Ensure that ->deadline is visible before set the started
* flag and clear the completed flag.
*/
smp_mb__before_atomic();
/* /*
* Mark us as started and clear complete. Complete might have been * Mark us as started and clear complete. Complete might have been
* set if requeue raced with timeout, which then marked it as * set if requeue raced with timeout, which then marked it as
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册