block: fix timeout changes for legacy request drivers
Subsystems (2)
PATCH 1/1 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.
--- block/blk-softirq.c | 1 + drivers/block/null_blk.c | 2 +- drivers/scsi/scsi_transport_fc.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
block/blk-softirq.c +1 -0
@@ -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
drivers/block/null_blk.c +1 -1
@@ -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 ; }
drivers/scsi/scsi_transport_fc.c +1 -1
@@ -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 ; }
Signature · 1 line
2.17.1
Jens Axboe
maintainerQuoted 5 lines · Christoph Hellwig
blk_mq_complete_requestcan only be called for blk-mq drivers, but when removing theBLK_EH_HANDLEDreturn value, two legacy request timeout methods incorrectly got switched to callblk_mq_complete_request. Call__blk_complete_requestinstead to reinstance the previous behavior. For that__blk_complete_requestneeds to be exported.
Yikes. Looks like blktests only smoke tests blk-mq timeout handling, we should add a test to do the same for !mq.
Signature · 1 line
Jens Axboe