浏览代码

block: ensure that the timer is always added

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>
Jens Axboe 11 年之前
父节点
当前提交
c7bca4183f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      block/blk-timeout.c

+ 1 - 1
block/blk-timeout.c

@@ -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);
 	}