1 From: Jens Axboe <jens.axboe@oracle.com>
2 Date: Tue Sep 16 09:54:11 2008 -0700
3 Subject: use rq complete marking in blk_abort_request()
4 Git: 7ba1fbaa4a478f72fbaf5a56af9c82a77966b4c7
7 We cannot abort a request if we raced with the timeout handler already,
8 or with the IO completion. So make blk_abort_request() mark the request
9 as complete, and only continue if we succeeded.
11 Found and suggested by Mike Anderson <andmike@linux.vnet.ibm.com>
13 Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
14 Signed-off-by: Hannes Reinecke <hare@suse.de>
17 block/blk-timeout.c | 2 ++
18 1 file changed, 2 insertions(+)
20 --- a/block/blk-timeout.c
21 +++ b/block/blk-timeout.c
22 @@ -99,6 +99,8 @@ void blk_rq_timed_out_timer(unsigned lon
24 void blk_abort_request(struct request *req)
26 + if (blk_mark_rq_complete(req))
28 blk_delete_timer(req);
29 blk_rq_timed_out(req);