block: use rq complete marking in blk_abort_request()
authorJens Axboe <jens.axboe@oracle.com>
Tue, 16 Sep 2008 16:54:11 +0000 (09:54 -0700)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 9 Oct 2008 06:56:17 +0000 (08:56 +0200)
We cannot abort a request if we raced with the timeout handler already,
or with the IO completion. So make blk_abort_request() mark the request
as complete, and only continue if we succeeded.

Found and suggested by Mike Anderson <andmike@linux.vnet.ibm.com>

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-timeout.c

index 9b4ad138bb33a4559a98fec2e0edc2136b8eff52..972a63f848fbb8541a099ae80ecce660cbe826cf 100644 (file)
@@ -158,6 +158,8 @@ void blk_rq_timed_out_timer(unsigned long data)
  */
 void blk_abort_request(struct request *req)
 {
+       if (blk_mark_rq_complete(req))
+               return;
        blk_delete_timer(req);
        blk_rq_timed_out(req);
 }