diff options
author | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-04-29 02:09:09 -0400 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-11-04 15:53:02 -0400 |
commit | 09a58f536436efed02ead722e835cb4ce7674afc (patch) | |
tree | 56f2285c62e2ddb88d4a6e79095dd2cd3285416d /drivers/block | |
parent | 22605f96810d073eb74051d0295b6577d6a6a563 (diff) |
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: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nvme.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c index 57f2b33a47dd..205405e7f6b0 100644 --- a/drivers/block/nvme.c +++ b/drivers/block/nvme.c | |||
@@ -310,9 +310,9 @@ static void bio_completion(struct nvme_queue *nvmeq, void *ctx, | |||
310 | dma_unmap_sg(nvmeq->q_dmadev, nbio->sg, nbio->nents, | 310 | dma_unmap_sg(nvmeq->q_dmadev, nbio->sg, nbio->nents, |
311 | bio_data_dir(bio) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); | 311 | bio_data_dir(bio) ? DMA_TO_DEVICE : DMA_FROM_DEVICE); |
312 | free_nbio(nvmeq, nbio); | 312 | free_nbio(nvmeq, nbio); |
313 | if (status) | 313 | if (status) { |
314 | bio_endio(bio, -EIO); | 314 | bio_endio(bio, -EIO); |
315 | if (bio->bi_vcnt > bio->bi_idx) { | 315 | } else if (bio->bi_vcnt > bio->bi_idx) { |
316 | bio_list_add(&nvmeq->sq_cong, bio); | 316 | bio_list_add(&nvmeq->sq_cong, bio); |
317 | wake_up_process(nvme_thread); | 317 | wake_up_process(nvme_thread); |
318 | } else { | 318 | } else { |