diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-30 18:51:00 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-30 11:31:34 -0600 |
commit | d250bf4e776ff09d51c97f83c7a19f65a9e1c5a5 (patch) | |
tree | 8b0d1aff3030f70300bd2be35b279ae24a131f8e /drivers/block | |
parent | 5e3c3a7ecefefaebc7c9a626fe4522cb85bbdaad (diff) | |
download | linux-stable-d250bf4e776ff09d51c97f83c7a19f65a9e1c5a5.tar.gz linux-stable-d250bf4e776ff09d51c97f83c7a19f65a9e1c5a5.tar.bz2 linux-stable-d250bf4e776ff09d51c97f83c7a19f65a9e1c5a5.zip |
blk-mq: only iterate over inflight requests in blk_mq_tagset_busy_iter
We already check for started commands in all callbacks, but we should
also protect against already completed commands. Do this by taking
the checks to common code.
Acked-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 12 | ||||
-rw-r--r-- | drivers/block/nbd.c | 5 |
2 files changed, 3 insertions, 14 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 95657b814543..c73626decb46 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2725,15 +2725,11 @@ static void mtip_softirq_done_fn(struct request *rq) blk_mq_end_request(rq, cmd->status); } -static void mtip_abort_cmd(struct request *req, void *data, - bool reserved) +static void mtip_abort_cmd(struct request *req, void *data, bool reserved) { struct mtip_cmd *cmd = blk_mq_rq_to_pdu(req); struct driver_data *dd = data; - if (!blk_mq_request_started(req)) - return; - dbg_printk(MTIP_DRV_NAME " Aborting request, tag = %d\n", req->tag); clear_bit(req->tag, dd->port->cmds_to_issue); @@ -2741,14 +2737,10 @@ static void mtip_abort_cmd(struct request *req, void *data, mtip_softirq_done_fn(req); } -static void mtip_queue_cmd(struct request *req, void *data, - bool reserved) +static void mtip_queue_cmd(struct request *req, void *data, bool reserved) { struct driver_data *dd = data; - if (!blk_mq_request_started(req)) - return; - set_bit(req->tag, dd->port->cmds_to_issue); blk_abort_request(req); } diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index a6e3a6f05791..3ed1ef8ee528 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -676,11 +676,8 @@ static void recv_work(struct work_struct *work) static void nbd_clear_req(struct request *req, void *data, bool reserved) { - struct nbd_cmd *cmd; + struct nbd_cmd *cmd = blk_mq_rq_to_pdu(req); - if (!blk_mq_request_started(req)) - return; - cmd = blk_mq_rq_to_pdu(req); cmd->status = BLK_STS_IOERR; blk_mq_complete_request(req); } |