diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-30 18:51:00 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-30 19:31:34 +0200 |
commit | d250bf4e776ff09d51c97f83c7a19f65a9e1c5a5 (patch) | |
tree | 8b0d1aff3030f70300bd2be35b279ae24a131f8e /drivers/block/nbd.c | |
parent | nbd: clear DISCONNECT_REQUESTED flag once disconnection occurs. (diff) | |
download | linux-d250bf4e776ff09d51c97f83c7a19f65a9e1c5a5.tar.xz linux-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/nbd.c')
-rw-r--r-- | drivers/block/nbd.c | 5 |
1 files changed, 1 insertions, 4 deletions
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); } |