aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-timeout.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-09-16 12:54:11 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:17 -0400
commit7ba1fbaa4a478f72fbaf5a56af9c82a77966b4c7 (patch)
tree275c1d86386d7db9fa75840363230098ca6bddd3 /block/blk-timeout.c
parent581d4e28d9195aa8b2231383dbabc288988d615e (diff)
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 <andmike@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-timeout.c')
-rw-r--r--block/blk-timeout.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 9b4ad138bb33..972a63f848fb 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -158,6 +158,8 @@ void blk_rq_timed_out_timer(unsigned long data)
158 */ 158 */
159void blk_abort_request(struct request *req) 159void blk_abort_request(struct request *req)
160{ 160{
161 if (blk_mark_rq_complete(req))
162 return;
161 blk_delete_timer(req); 163 blk_delete_timer(req);
162 blk_rq_timed_out(req); 164 blk_rq_timed_out(req);
163} 165}