Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3295874b authored by Keith Busch's avatar Keith Busch Committed by Matthew Wilcox
Browse files

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: default avatarKeith Busch <keith.busch@intel.com>
Signed-off-by: default avatarMatthew Wilcox <matthew.r.wilcox@intel.com>
parent 859361a2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);