Skip to content

Commit

Permalink
block: fix timeout changes for legacy request drivers
Browse files Browse the repository at this point in the history
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: 1fc2b62 ("scsi_transport_fc: complete requests from ->timeout")
Fixes: 0df0bb0 ("null_blk: complete requests from ->timeout")
Reported-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jun 19, 2018
1 parent d6c7396 commit 0cc61e6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions block/blk-softirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ void __blk_complete_request(struct request *req)

local_irq_restore(flags);
}
EXPORT_SYMBOL(__blk_complete_request);

/**
* blk_complete_request - end I/O on a request
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/null_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
pr_info("null: rq %p timed out\n", rq);
blk_mq_complete_request(rq);
__blk_complete_request(rq);
return BLK_EH_DONE;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3592,7 +3592,7 @@ fc_bsg_job_timeout(struct request *req)

/* the blk_end_sync_io() doesn't check the error */
if (inflight)
blk_mq_complete_request(req);
__blk_complete_request(req);
return BLK_EH_DONE;
}

Expand Down

0 comments on commit 0cc61e6

Please sign in to comment.