From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgxiV-0004Kj-IB for qemu-devel@nongnu.org; Wed, 22 Oct 2014 11:20:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgxiQ-00086i-J6 for qemu-devel@nongnu.org; Wed, 22 Oct 2014 11:20:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgxiQ-00086e-B5 for qemu-devel@nongnu.org; Wed, 22 Oct 2014 11:20:46 -0400 Date: Wed, 22 Oct 2014 17:20:40 +0200 From: Kevin Wolf Message-ID: <20141022152040.GR3188@noname.str.redhat.com> References: <1413990017-19213-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1413990017-19213-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 0/3] block: Fix is_allocated() for truncated images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , =?iso-8859-1?Q?Beno=EEt?= Canet Am 22.10.2014 um 17:00 hat Max Reitz geschrieben: > Patch 2: > The bdrv_is_allocated() functions may return a number of zero sectors > e.g. if a sector beyond the image end has been queried. Respect this > case in qemu-io's map implementation so it doesn't run into an infinite > loop (https://bugs.launchpad.net/qemu/+bug/1356969). > > Patch 1: > In that bug report, bdrv_co_get_block_status() fell through to the > underlying file to get additional information (whether the sectors are > zeroed). However, the offset reported by the image format (qcow2) was > beyond the size of the underlying file and so this second query returned > only zero clusters which replaced the actual number of sectors queried > in the "formatted" (on qcow2 level) image. This replacement is generally > fine because it allows bdrv_co_get_block_status() to follow the > granularity (holes and non-holes) of the underlying file, but not if > only zero clusters could be queried (which indicates a request beyond > the image end). > This patch makes bdrv_co_get_block_status() respect the underlying > file's EOF and act accordingly. > > Patch 3 adds a test for patch 1; a test which depends on patch 2 is > included in v3 of my series "raw-posix: Fix raw_co_get_block_status()". Thanks, applied to the block branch. Kevin