[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.1 1/2] mirror: Fix qiov size for short req
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-2.1 1/2] mirror: Fix qiov size for short requests |
Date: |
Tue, 01 Jul 2014 10:52:58 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
On 07/01/2014 08:52 AM, Kevin Wolf wrote:
> When mirroring an image of a size that is not a multiple of the
> mirror job granularity, the last request would have the right nb_sectors
> argument, but a qiov that is rounded up to the next multiple of the
> granularity. Don't do this.
>
> This fixes a segfault that is caused by raw-posix being confused by this
> and allocating a buffer with request length, but operating on it with
> qiov length.
>
> Reported-by: Eric Blake <address@hidden>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block/mirror.c | 4 +++-
> tests/qemu-iotests/041 | 5 +++++
> tests/qemu-iotests/041.out | 4 ++--
> 3 files changed, 10 insertions(+), 3 deletions(-)
>
> +++ b/tests/qemu-iotests/041
> @@ -219,6 +219,11 @@ class TestSingleDriveZeroLength(TestSingleDrive):
> test_small_buffer2 = None
> test_large_cluster = None
>
> +class TestSingleDriverUnalignedLength(TestSingleDrive):
s/Driver/Drive/ for consistency in the class name?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature