]> git.kernelconcepts.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 12 May 2010 21:57:05 +0000 (14:57 -0700)
commita59bb6a18c9fc9ed48804d5d2868ce2d301925e5
tree98c4fdd272974667d56253fb17433e2fd6cd33bc
parent48a5414b50f47157ef4ff0ab52a86144f1804c19
block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer

commit a534dbe96e9929c7245924d8252d89048c23d569 upstream.

blk_rq_timed_out_timer() relied on blk_add_timer() never returning a
timer value of zero, but commit 7838c15b8dd18e78a523513749e5b54bda07b0cb
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>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
block/blk-timeout.c