Commit 09a58f53 authored by Matthew Wilcox's avatar Matthew Wilcox

NVMe: Fix bug in error handling

When an I/O completed with an error, we would call bio_endio twice
(once with -EIO and once with 0).  Found by inspection.
Signed-off-by: default avatarMatthew Wilcox <matthew.r.wilcox@intel.com>
parent 22605f96
...@@ -310,9 +310,9 @@ static void bio_completion(struct nvme_queue *nvmeq, void *ctx, ...@@ -310,9 +310,9 @@ static void bio_completion(struct nvme_queue *nvmeq, void *ctx,
dma_unmap_sg(nvmeq->q_dmadev, nbio->sg, nbio->nents, dma_unmap_sg(nvmeq->q_dmadev, nbio->sg, nbio->nents,
bio_data_dir(bio) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); bio_data_dir(bio) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
free_nbio(nvmeq, nbio); free_nbio(nvmeq, nbio);
if (status) if (status) {
bio_endio(bio, -EIO); bio_endio(bio, -EIO);
if (bio->bi_vcnt > bio->bi_idx) { } else if (bio->bi_vcnt > bio->bi_idx) {
bio_list_add(&nvmeq->sq_cong, bio); bio_list_add(&nvmeq->sq_cong, bio);
wake_up_process(nvme_thread); wake_up_process(nvme_thread);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment