block: check for timeout function in blk_rq_timed_out()
authorHannes Reinecke <hare@suse.de>
Wed, 30 Jan 2013 09:26:17 +0000 (09:26 +0000)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 1 Jul 2013 15:31:23 +0000 (17:31 +0200)
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>
block/blk-timeout.c

index 6e4744c..65f1035 100644 (file)
@@ -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;
 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);
        switch (ret) {
        case BLK_EH_HANDLED:
                __blk_complete_request(req);