From patchwork Fri Feb 11 14:21:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 82807 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 DE191B7179 for ; Sat, 12 Feb 2011 04:37:36 +1100 (EST) Received: from localhost ([127.0.0.1]:48813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pntx7-0004eg-7O for incoming@patchwork.ozlabs.org; Fri, 11 Feb 2011 09:26:29 -0500 Received: from [140.186.70.92] (port=54372 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pntqr-0001b9-9p for qemu-devel@nongnu.org; Fri, 11 Feb 2011 09:20:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pntqp-0003Yp-Oe for qemu-devel@nongnu.org; Fri, 11 Feb 2011 09:20:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pntqp-0003Yk-Ed for qemu-devel@nongnu.org; Fri, 11 Feb 2011 09:19:59 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1BEJvRT018837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Feb 2011 09:19:58 -0500 Received: from dhcp-5-188.str.redhat.com (vpn1-6-92.ams2.redhat.com [10.36.6.92]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1BEJlNK027710; Fri, 11 Feb 2011 09:19:56 -0500 From: Kevin Wolf To: jmforbes@linuxtx.org Date: Fri, 11 Feb 2011 15:21:28 +0100 Message-Id: <1297434094-24965-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1297434094-24965-1-git-send-email-kwolf@redhat.com> References: <1297434094-24965-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 STABLE 0.14 3/9] 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 (cherry picked from commit 3ab4c7e92d39d40e6dc0bdb1c2320889543691cb) --- 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)