diff options
author | Keith Busch <keith.busch@intel.com> | 2012-08-20 22:57:49 +0200 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2012-11-13 15:13:49 +0100 |
commit | 3295874b6074d749516d6decd43afad7bf6e38ff (patch) | |
tree | ff2acce6c13bdaed845b00b9960b0663c24ce589 /drivers/block | |
parent | NVMe: Free cmdid on nvme_submit_bio error (diff) | |
download | linux-3295874b6074d749516d6decd43afad7bf6e38ff.tar.xz linux-3295874b6074d749516d6decd43afad7bf6e38ff.zip |
NVMe: End queued bio requests when freeing queue
If the queue has bios queued on it when it is freed, bio_endio() must be
called for them first.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nvme.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index 954a61018dc2..af88635e44e4 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c @@ -909,6 +909,10 @@ static void nvme_free_queue(struct nvme_dev *dev, int qid) spin_lock_irq(&nvmeq->q_lock); nvme_cancel_ios(nvmeq, false); + while (bio_list_peek(&nvmeq->sq_cong)) { + struct bio *bio = bio_list_pop(&nvmeq->sq_cong); + bio_endio(bio, -EIO); + } spin_unlock_irq(&nvmeq->q_lock); irq_set_affinity_hint(vector, NULL); |