Skip to content

Commit

Permalink
block: use rq complete marking in blk_abort_request()
Browse files Browse the repository at this point in the history
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 <[email protected]>

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe committed Oct 9, 2008
1 parent 581d4e2 commit 7ba1fba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions block/blk-timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7ba1fba

Please sign in to comment.