From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiLZ6-0000kx-7U for qemu-devel@nongnu.org; Wed, 15 Apr 2015 07:33:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YiLZ4-0006Ur-Tr for qemu-devel@nongnu.org; Wed, 15 Apr 2015 07:33:08 -0400 Date: Wed, 15 Apr 2015 07:32:57 -0400 From: Jeff Cody Message-ID: <20150415113257.GC2952@localhost.localdomain> References: <1429090046-6359-1-git-send-email-kwolf@redhat.com> <1429090046-6359-3-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1429090046-6359-3-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] vhdx: Fix zero-fill iov length List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org On Wed, Apr 15, 2015 at 11:27:26AM +0200, Kevin Wolf wrote: > Fix the length of the zero-fill for the back, which was accidentally > using the same value as for the front. This is caught by qemu-iotests > 033. > > For consistency, change the code for the front as well to use the length > stored in the iov (it is the same value, copied four lines above). > > Signed-off-by: Kevin Wolf > --- > block/vhdx.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/block/vhdx.c b/block/vhdx.c > index bb3ed45..e24062f 100644 > --- a/block/vhdx.c > +++ b/block/vhdx.c > @@ -1269,7 +1269,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, > iov1.iov_base = qemu_blockalign(bs, iov1.iov_len); > memset(iov1.iov_base, 0, iov1.iov_len); > qemu_iovec_concat_iov(&hd_qiov, &iov1, 1, 0, > - sinfo.block_offset); > + iov1.iov_len); Better form here, although should be identical > sectors_to_write += iov1.iov_len >> BDRV_SECTOR_BITS; > } > > @@ -1285,7 +1285,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, > iov2.iov_base = qemu_blockalign(bs, iov2.iov_len); > memset(iov2.iov_base, 0, iov2.iov_len); > qemu_iovec_concat_iov(&hd_qiov, &iov2, 1, 0, > - sinfo.block_offset); > + iov2.iov_len); Definite bug fix here > sectors_to_write += iov2.iov_len >> BDRV_SECTOR_BITS; > } > } > -- > 1.8.3.1 > Acked-by: Jeff Cody