All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel@nongnu.org, qemu-stable@nongnu.org,
	Claudio Fontana <cfontana@suse.de>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Bruce Rogers <brogers@suse.com>
Subject: Re: [PATCH for-5.1 1/2] block: Fix bdrv_aligned_p*v() for qiov_offset != 0
Date: Tue, 28 Jul 2020 14:25:41 +0200	[thread overview]
Message-ID: <5e8316f0-7e46-4157-46f8-a865cebf2382@redhat.com> (raw)
In-Reply-To: <20200728120806.265916-2-mreitz@redhat.com>

On 7/28/20 2:08 PM, Max Reitz wrote:
> Since these functions take a @qiov_offset, they must always take it into
> account when working with @qiov.  There are a couple of places where
> they do not, but they should.
> 
> Fixes: 65cd4424b9df03bb5195351c33e04cbbecc0705c
> Fixes: 28c4da28695bdbe04b336b2c9c463876cc3aaa6d

Maybe:
Fixes: 65cd4424b9 ("bdrv_aligned_preadv: use and support qiov_offset")
Fixes: 28c4da2869 ("bdrv_aligned_pwritev: use and support qiov_offset")

> Reported-by: Claudio Fontana <cfontana@suse.de>
> Reported-by: Bruce Rogers <brogers@suse.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/io.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/block/io.c b/block/io.c
> index b6564e34c5..ad3a51ed53 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -1524,12 +1524,13 @@ static int coroutine_fn bdrv_aligned_preadv(BdrvChild *child,
>              assert(num);
>  
>              ret = bdrv_driver_preadv(bs, offset + bytes - bytes_remaining,
> -                                     num, qiov, bytes - bytes_remaining, 0);
> +                                     num, qiov,
> +                                     qiov_offset + bytes - bytes_remaining, 0);
>              max_bytes -= num;
>          } else {
>              num = bytes_remaining;
> -            ret = qemu_iovec_memset(qiov, bytes - bytes_remaining, 0,
> -                                    bytes_remaining);
> +            ret = qemu_iovec_memset(qiov, qiov_offset + bytes - bytes_remaining,
> +                                    0, bytes_remaining);
>          }
>          if (ret < 0) {
>              goto out;
> @@ -2032,7 +2033,8 @@ static int coroutine_fn bdrv_aligned_pwritev(BdrvChild *child,
>              }
>  
>              ret = bdrv_driver_pwritev(bs, offset + bytes - bytes_remaining,
> -                                      num, qiov, bytes - bytes_remaining,
> +                                      num, qiov,
> +                                      qiov_offset + bytes - bytes_remaining,
>                                        local_flags);
>              if (ret < 0) {
>                  break;
> 



  parent reply	other threads:[~2020-07-28 12:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 12:08 [PATCH for-5.1 0/2] block: Fix bdrv_aligned_p*v() for qiov_offset != 0 Max Reitz
2020-07-28 12:08 ` [PATCH for-5.1 1/2] " Max Reitz
2020-07-28 12:14   ` Vladimir Sementsov-Ogievskiy
2020-07-28 12:25   ` Philippe Mathieu-Daudé [this message]
2020-07-28 12:55   ` Claudio Fontana
2020-07-28 13:27   ` Bruce Rogers
2020-07-28 12:08 ` [PATCH for-5.1 2/2] iotests/028: Add test for cross-base-EOF reads Max Reitz
2020-07-28 12:22   ` Vladimir Sementsov-Ogievskiy
2020-07-28 12:56   ` Claudio Fontana

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=5e8316f0-7e46-4157-46f8-a865cebf2382@redhat.com \
    --to=philmd@redhat.com \
    --cc=brogers@suse.com \
    --cc=cfontana@suse.de \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /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.