block: ensure that the timer is always added

Commit f793aa5378 relaxed the timer addition a little too much.
If the timer isn't pending, we always need to add it.

Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
Jens Axboe 2014-05-30 15:41:39 -06:00
parent ee3c5db089
commit c7bca4183f

View File

@ -224,7 +224,7 @@ void blk_add_timer(struct request *req)
* modifying the timer because expires for value X
* will be X + something.
*/
if (diff >= HZ / 2)
if (!timer_pending(&q->timeout) || (diff >= HZ / 2))
mod_timer(&q->timeout, expiry);
}