From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X21Ip-00068n-NP for qemu-devel@nongnu.org; Tue, 01 Jul 2014 12:53:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X21Ij-0005WV-FP for qemu-devel@nongnu.org; Tue, 01 Jul 2014 12:53:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X21Ij-0005Tb-7Q for qemu-devel@nongnu.org; Tue, 01 Jul 2014 12:53:01 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s61GqwVs018912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 1 Jul 2014 12:52:59 -0400 Message-ID: <53B2E76A.9000704@redhat.com> Date: Tue, 01 Jul 2014 10:52:58 -0600 From: Eric Blake MIME-Version: 1.0 References: <1404226342-20174-1-git-send-email-kwolf@redhat.com> <1404226342-20174-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1404226342-20174-2-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NqLw3E9cDr1KGrqmOXwXU969nBW1cwC0w" Subject: Re: [Qemu-devel] [PATCH for-2.1 1/2] mirror: Fix qiov size for short requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NqLw3E9cDr1KGrqmOXwXU969nBW1cwC0w Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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_sector= s > argument, but a qiov that is rounded up to the next multiple of the > granularity. Don't do this. >=20 > This fixes a segfault that is caused by raw-posix being confused by thi= s > and allocating a buffer with request length, but operating on it with > qiov length. >=20 > Reported-by: Eric Blake > Signed-off-by: Kevin Wolf > --- > block/mirror.c | 4 +++- > tests/qemu-iotests/041 | 5 +++++ > tests/qemu-iotests/041.out | 4 ++-- > 3 files changed, 10 insertions(+), 3 deletions(-) >=20 > +++ b/tests/qemu-iotests/041 > @@ -219,6 +219,11 @@ class TestSingleDriveZeroLength(TestSingleDrive): > test_small_buffer2 =3D None > test_large_cluster =3D None > =20 > +class TestSingleDriverUnalignedLength(TestSingleDrive): s/Driver/Drive/ for consistency in the class name? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NqLw3E9cDr1KGrqmOXwXU969nBW1cwC0w Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTsudqAAoJEKeha0olJ0NqgPcH/jX/V3p6OfBx//Xb0CcIrfmr pNhapZyMdwdmzm9xfi+uurDFRd+cEeDkVU4ufRvWmbmbbuCyuSi1HrfwaAnVAfOF DYtiA4DlHA67KHaqFoxEHP9QfbXV7WgwS3vnjHGr1InqZh3MgapnBPgbQ0ti6UEa pGH2Q/Pz9a8BI8JUnaKJ+pQnrLtp1F/EfJBtYel7pqwcH3U4p+mvlTehWn8ZX6x3 UrVcv35H4XXNQ9FO3s16YufcwZdRYYkxrHcpri7QvUjZNfZh0ylYRvOOnAEZNL+R rJp0f/39A+Op7Xguvj7Sloj8dJgfoyLm8z85Y3P//vkmzGR/nFIP9YSjEDzBuAk= =uiBs -----END PGP SIGNATURE----- --NqLw3E9cDr1KGrqmOXwXU969nBW1cwC0w--