OSDN Git Service

blk-mq: move failure injection out of blk_mq_complete_request
authorChristoph Hellwig <hch@lst.de>
Thu, 11 Jun 2020 06:44:47 +0000 (08:44 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 Jun 2020 15:15:57 +0000 (09:15 -0600)
commit15f73f5b3e5958f2d169fe13c420eeeeae07bbf2
treeda4308ed35371e693bb35b85855e2f984aa465b2
parentd391a7a399e46315a8adc65eb8fb5d9123b91700
blk-mq: move failure injection out of blk_mq_complete_request

Move the call to blk_should_fake_timeout out of blk_mq_complete_request
and into the drivers, skipping call sites that are obvious error
handlers, and remove the now superflous blk_mq_force_complete_rq helper.
This ensures we don't keep injecting errors into completions that just
terminate the Linux request after the hardware has been reset or the
command has been aborted.

Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
19 files changed:
block/blk-mq.c
block/blk-timeout.c
block/blk.h
block/bsg-lib.c
drivers/block/loop.c
drivers/block/mtip32xx/mtip32xx.c
drivers/block/nbd.c
drivers/block/null_blk_main.c
drivers/block/skd_main.c
drivers/block/virtio_blk.c
drivers/block/xen-blkfront.c
drivers/md/dm-rq.c
drivers/mmc/core/block.c
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/s390/block/dasd.c
drivers/s390/block/scm_blk.c
drivers/scsi/scsi_lib.c
include/linux/blk-mq.h