From: Jens Axboe Date: Tue Sep 16 09:54:11 2008 -0700 Subject: use rq complete marking in blk_abort_request() Git: 7ba1fbaa4a478f72fbaf5a56af9c82a77966b4c7 References: bnc#434105 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 Signed-off-by: Hannes Reinecke --- block/blk-timeout.c | 2 ++ 1 file changed, 2 insertions(+) --- a/block/blk-timeout.c +++ b/block/blk-timeout.c @@ -99,6 +99,8 @@ void blk_rq_timed_out_timer(unsigned lon */ void blk_abort_request(struct request *req) { + if (blk_mark_rq_complete(req)) + return; blk_delete_timer(req); blk_rq_timed_out(req); }