All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-stable@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 2/3] block: Fix NULL deference for unaligned write if qiov is NULL
Date: Mon, 27 Apr 2015 12:45:02 +0200	[thread overview]
Message-ID: <553E132E.6010606@redhat.com> (raw)
In-Reply-To: <1430113219-12522-3-git-send-email-famz@redhat.com>



On 27/04/2015 07:40, Fam Zheng wrote:
> +
> +    if (!qiov) {

Perhaps "if (!qiov && bytes >= align)"?

Paolo

> +        uint64_t aligned_bytes = bytes & ~(align - 1);
> +
> +        assert((offset & (align - 1)) == 0);
> +        ret = bdrv_aligned_pwritev(bs, &req, offset, aligned_bytes,
> +                                   NULL, flags);
> +        if (ret < 0) {
> +            goto fail;
> +        }
> +        bytes -= aligned_bytes;
> +        offset += aligned_bytes;
>      }

  reply	other threads:[~2015-04-27 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27  5:40 [Qemu-devel] [PATCH v3 0/3] block: Fix unaligned bdrv_aio_write_zeroes Fam Zheng
2015-04-27  5:40 ` [Qemu-devel] [PATCH v3 1/3] Revert "block: Fix unaligned zero write" Fam Zheng
2015-04-27  5:40 ` [Qemu-devel] [PATCH v3 2/3] block: Fix NULL deference for unaligned write if qiov is NULL Fam Zheng
2015-04-27 10:45   ` Paolo Bonzini [this message]
2015-04-27 12:41     ` Fam Zheng
2015-04-27  5:40 ` [Qemu-devel] [PATCH v3 3/3] qemu-iotests: Test unaligned sub-block zero write Fam Zheng

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=553E132E.6010606@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=stefanha@redhat.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.