Skip to content

Commit

Permalink
NVMe: Fix bug in error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Wilcox committed Nov 4, 2011
1 parent 22605f9 commit 09a58f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ static void bio_completion(struct nvme_queue *nvmeq, void *ctx,
dma_unmap_sg(nvmeq->q_dmadev, nbio->sg, nbio->nents,
bio_data_dir(bio) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
free_nbio(nvmeq, nbio);
if (status)
if (status) {
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);
wake_up_process(nvme_thread);
} else {
Expand Down

0 comments on commit 09a58f5

Please sign in to comment.