All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] vhdx: Fix zero-fill iov length
Date: Wed, 15 Apr 2015 07:32:57 -0400	[thread overview]
Message-ID: <20150415113257.GC2952@localhost.localdomain> (raw)
In-Reply-To: <1429090046-6359-3-git-send-email-kwolf@redhat.com>

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 <kwolf@redhat.com>
> ---
>  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 <jcody@redhat.com>

      reply	other threads:[~2015-04-15 11:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15  9:27 [Qemu-devel] [PATCH 0/2] Fix VHDX qemu-iotests 033 failure Kevin Wolf
2015-04-15  9:27 ` [Qemu-devel] [PATCH 1/2] blkdebug: Add bdrv_truncate() Kevin Wolf
2015-04-15 11:35   ` Jeff Cody
2015-04-15  9:27 ` [Qemu-devel] [PATCH 2/2] vhdx: Fix zero-fill iov length Kevin Wolf
2015-04-15 11:32   ` Jeff Cody [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150415113257.GC2952@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.