summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2013-01-30 13:26:17 +0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-07-01 19:31:23 +0400
commit80bd7181b036c7b4118eb19cfff3b555889596e6 (patch)
tree455e4df7bef9ebc9cfbddb1a5936fa1f1cfeeee5 /block
parentd1ffc1f8660e749a2683f19ee7cfdd837568b37a (diff)
downloadlinux-80bd7181b036c7b4118eb19cfff3b555889596e6.tar.xz
block: check for timeout function in blk_rq_timed_out()
rq_timed_out_fn might have been unset while the request was in flight, so we need to check for it in blk_rq_timed_out(). Acked-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-timeout.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 6e4744cbfb56..65f103563969 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -82,9 +82,10 @@ void blk_delete_timer(struct request *req)
static void blk_rq_timed_out(struct request *req)
{
struct request_queue *q = req->q;
- enum blk_eh_timer_return ret;
+ enum blk_eh_timer_return ret = BLK_EH_RESET_TIMER;
- ret = q->rq_timed_out_fn(req);
+ if (q->rq_timed_out_fn)
+ ret = q->rq_timed_out_fn(req);
switch (ret) {
case BLK_EH_HANDLED:
__blk_complete_request(req);