]> git.baikalelectronics.ru Git - kernel.git/commit
block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer
authorRichard Kennedy <richard@rsk.demon.co.uk>
Wed, 14 Apr 2010 18:54:03 +0000 (20:54 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 21 Apr 2010 15:42:08 +0000 (17:42 +0200)
commit09259e4ecfc0dc51f4cb0cd984f3e28a8dfcf9b4
tree394151a29dc2ea43e20cbf5b605732525ce09d9d
parent2b72a1aae286603f96b635a3c6c07a50ad542497
block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer

blk_rq_timed_out_timer() relied on blk_add_timer() never returning a
timer value of zero, but commit 1ab871e05ec469e1ff119292c14430611f038000
removed the code that bumped this value when it was zero.
Therefore when jiffies is near wrap we could get unlucky & not set the
timeout value correctly.

This patch uses a flag to indicate that the timeout value was set and so
handles jiffies wrap correctly, and it keeps all the logic in one
function so should be easier to maintain in the future.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-timeout.c