From patchwork Thu Feb 10 15:51:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 82616 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6E481B710F for ; Fri, 11 Feb 2011 02:51:15 +1100 (EST) Received: from localhost ([127.0.0.1]:56297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnYnf-0000YZ-It for incoming@patchwork.ozlabs.org; Thu, 10 Feb 2011 10:51:19 -0500 Received: from [140.186.70.92] (port=36652 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnYmI-0000WM-QV for qemu-devel@nongnu.org; Thu, 10 Feb 2011 10:49:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnYmA-0007y8-A3 for qemu-devel@nongnu.org; Thu, 10 Feb 2011 10:49:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnYmA-0007xi-2K for qemu-devel@nongnu.org; Thu, 10 Feb 2011 10:49:46 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1AFniXS002012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Feb 2011 10:49:44 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1AFndit022312; Thu, 10 Feb 2011 10:49:43 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Thu, 10 Feb 2011 16:51:18 +0100 Message-Id: <1297353086-4844-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1297353086-4844-1-git-send-email-kwolf@redhat.com> References: <1297353086-4844-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 03/11] qcow2: Fix error handling for immediate backing file read failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Requests could return success even though they failed when bdrv_aio_readv returned NULL for a backing file read. Reported-by: Chunqiang Tang Signed-off-by: Kevin Wolf --- block/qcow2.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 28338bf..647c2a4 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -479,8 +479,10 @@ static void qcow2_aio_read_cb(void *opaque, int ret) BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO); acb->hd_aiocb = bdrv_aio_readv(bs->backing_hd, acb->sector_num, &acb->hd_qiov, n1, qcow2_aio_read_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } } else { ret = qcow2_schedule_bh(qcow2_aio_read_bh, acb); if (ret < 0)