Commit 0cc61e64 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: fix timeout changes for legacy request drivers

blk_mq_complete_request can only be called for blk-mq drivers, but when
removing the BLK_EH_HANDLED return value, two legacy request timeout
methods incorrectly got switched to call blk_mq_complete_request.
Call __blk_complete_request instead to reinstance the previous behavior.
For that __blk_complete_request needs to be exported.

Fixes: 1fc2b62e ("scsi_transport_fc: complete requests from ->timeout")
Fixes: 0df0bb08 ("null_blk: complete requests from ->timeout")
Reported-by: default avatarJianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d6c73964
...@@ -144,6 +144,7 @@ void __blk_complete_request(struct request *req) ...@@ -144,6 +144,7 @@ void __blk_complete_request(struct request *req)
local_irq_restore(flags); local_irq_restore(flags);
} }
EXPORT_SYMBOL(__blk_complete_request);
/** /**
* blk_complete_request - end I/O on a request * blk_complete_request - end I/O on a request
......
...@@ -1365,7 +1365,7 @@ static blk_qc_t null_queue_bio(struct request_queue *q, struct bio *bio) ...@@ -1365,7 +1365,7 @@ static blk_qc_t null_queue_bio(struct request_queue *q, struct bio *bio)
static enum blk_eh_timer_return null_rq_timed_out_fn(struct request *rq) static enum blk_eh_timer_return null_rq_timed_out_fn(struct request *rq)
{ {
pr_info("null: rq %p timed out\n", rq); pr_info("null: rq %p timed out\n", rq);
blk_mq_complete_request(rq); __blk_complete_request(rq);
return BLK_EH_DONE; return BLK_EH_DONE;
} }
......
...@@ -3592,7 +3592,7 @@ fc_bsg_job_timeout(struct request *req) ...@@ -3592,7 +3592,7 @@ fc_bsg_job_timeout(struct request *req)
/* the blk_end_sync_io() doesn't check the error */ /* the blk_end_sync_io() doesn't check the error */
if (inflight) if (inflight)
blk_mq_complete_request(req); __blk_complete_request(req);
return BLK_EH_DONE; return BLK_EH_DONE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment