From: Jens Axboe Date: Tue, 16 Sep 2008 16:54:11 +0000 (-0700) Subject: block: use rq complete marking in blk_abort_request() X-Git-Tag: v2.6.28-rc1~733^2~34 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7ba1fbaa4a478f72fbaf5a56af9c82a77966b4c7;p=linux-2.6-omap-h63xx.git block: use rq complete marking in blk_abort_request() 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 Signed-off-by: Jens Axboe --- diff --git a/block/blk-timeout.c b/block/blk-timeout.c index 9b4ad138bb3..972a63f848f 100644 --- a/block/blk-timeout.c +++ b/block/blk-timeout.c @@ -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); }