From 171e3d6b9997c98a97d0c525867f7cd9b640cadd Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 6 Apr 2010 15:30:09 +0200 Subject: qcow2: Don't ignore immediate read/write failures Returning -EIO is far from optimal, but at least it's an error code. Signed-off-by: Kevin Wolf Signed-off-by: Aurelien Jarno --- block/qcow2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 5b6dad9d59..b44a12cdeb 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -468,8 +468,10 @@ static void qcow_aio_read_cb(void *opaque, int ret) (acb->cluster_offset >> 9) + index_in_cluster, &acb->hd_qiov, acb->cur_nr_sectors, qcow_aio_read_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } } return; @@ -621,8 +623,10 @@ static void qcow_aio_write_cb(void *opaque, int ret) (acb->cluster_offset >> 9) + index_in_cluster, &acb->hd_qiov, acb->cur_nr_sectors, qcow_aio_write_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } return; -- cgit v1.2.3