From: Stefan Hajnoczi <stefanha@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
pbonzini@redhat.com, qemu-devel@nongnu.org,
qemu-block@nongnu.org, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v7 0/3] block: Fix unaligned bdrv_aio_write_zeroes
Date: Mon, 18 May 2015 11:01:02 +0100 [thread overview]
Message-ID: <20150518100102.GD2679@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1431522721-3266-1-git-send-email-famz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]
On Wed, May 13, 2015 at 01:11:58PM +0000, Fam Zheng wrote:
> v7: Add Kevin's rev-by in patch 1 and 3.
> Address Stefan's and Kevin's comments on patch 2:
> - Don't duplicate tracked_request_begin and tracked_request_end;
> - Don't forget to remove debug printf;
> - Call qemu_vfree unconditionally;
> - Don't serialize aligned part of the zero write req;
>
> An unaligned zero write causes NULL deferencing in bdrv_co_do_pwritev. That
> path is reachable from bdrv_co_write_zeroes and bdrv_aio_write_zeroes.
>
> You can easily trigger through the former with qemu-io, as the test case added
> by 61815d6e0aa. For bdrv_aio_write_zeroes, in common cases there's always a
> format driver (which uses 512 alignment), so it would be much rarer to have
> unaligned requests (only concerning top level here, when the request goes down
> to bs->file, where for example the alignment is 4k, it would then be calling
> bdrv_co_write_zeroes because it's in a coroutine).
>
> fc3959e4669a1c fixed bdrv_co_write_zeroes but not bdrv_aio_write_zeroes. The
> lattern is the actually used one by device model. Revert the previous fix, do
> it in bdrv_co_do_pwritev, to cover both paths.
>
>
>
> Fam Zheng (3):
> Revert "block: Fix unaligned zero write"
> block: Fix NULL deference for unaligned write if qiov is NULL
> qemu-iotests: Test unaligned sub-block zero write
>
> block/io.c | 142 ++++++++++++++++++++++++++++++++-------------
> tests/qemu-iotests/033 | 13 +++++
> tests/qemu-iotests/033.out | 30 ++++++++++
> 3 files changed, 144 insertions(+), 41 deletions(-)
>
> --
> 2.4.0
>
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-05-18 10:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 13:11 [Qemu-devel] [PATCH v7 0/3] block: Fix unaligned bdrv_aio_write_zeroes Fam Zheng
2015-05-13 13:11 ` [Qemu-devel] [PATCH v7 1/3] Revert "block: Fix unaligned zero write" Fam Zheng
2015-05-13 13:12 ` [Qemu-devel] [PATCH v7 2/3] block: Fix NULL deference for unaligned write if qiov is NULL Fam Zheng
2015-05-18 10:00 ` Stefan Hajnoczi
2015-05-13 13:12 ` [Qemu-devel] [PATCH v7 3/3] qemu-iotests: Test unaligned sub-block zero write Fam Zheng
2015-05-18 10:01 ` Stefan Hajnoczi [this message]
2015-05-18 10:05 ` [Qemu-devel] [PATCH v7 0/3] block: Fix unaligned bdrv_aio_write_zeroes Stefan Hajnoczi
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=20150518100102.GD2679@stefanha-thinkpad.redhat.com \
--to=stefanha@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).