block: ensure that the timer is always added
authorJens Axboe <axboe@fb.com>
Fri, 30 May 2014 21:41:39 +0000 (15:41 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 30 May 2014 21:41:39 +0000 (15:41 -0600)
Commit f793aa537866 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>
block/blk-timeout.c

index 43e8b515806f2c7dbe51c7c191d679abb62b77bc..95a09590ccfda8366f92efbee7c31f1654c11637 100644 (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);
        }