From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQzG8-0006kl-Uh for qemu-devel@nongnu.org; Mon, 08 Sep 2014 09:45:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQzG2-0000ne-Os for qemu-devel@nongnu.org; Mon, 08 Sep 2014 09:45:32 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:59208 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQzG2-0000nR-Ir for qemu-devel@nongnu.org; Mon, 08 Sep 2014 09:45:26 -0400 Date: Mon, 8 Sep 2014 15:44:34 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140908134434.GB22582@irqsave.net> References: <1409935888-18552-1-git-send-email-pl@kamp.de> <1409935888-18552-3-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1409935888-18552-3-git-send-email-pl@kamp.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/4] block: immediately cancel oversized read/write requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, stefanha@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, ronniesahlberg@gmail.com, pbonzini@redhat.com The Friday 05 Sep 2014 =E0 18:51:26 (+0200), Peter Lieven wrote : > Signed-off-by: Peter Lieven > --- > block.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > diff --git a/block.c b/block.c > index 2c4a5de..fa4c34b 100644 > --- a/block.c > +++ b/block.c > @@ -3215,6 +3215,13 @@ static int coroutine_fn bdrv_co_do_readv(BlockDr= iverState *bs, > return -EINVAL; > } > =20 > + if (bs->bl.max_transfer_length && nb_sectors > bs->bl.max_transfer= _length) { > + error_report("read of %d sectors at sector %ld exceeds device = max" > + " transfer length of %d sectors.", nb_sectors, se= ctor_num, > + bs->bl.max_transfer_length); > + return -EINVAL; > + } > + > return bdrv_co_do_preadv(bs, sector_num << BDRV_SECTOR_BITS, > nb_sectors << BDRV_SECTOR_BITS, qiov, fla= gs); > } > @@ -3507,6 +3514,13 @@ static int coroutine_fn bdrv_co_do_writev(BlockD= riverState *bs, > return -EINVAL; > } > =20 > + if (bs->bl.max_transfer_length && nb_sectors > bs->bl.max_transfer= _length) { > + error_report("write of %d sectors at sector %ld exceeds device= max" > + " transfer length of %d sectors.", nb_sectors, se= ctor_num, > + bs->bl.max_transfer_length); > + return -EINVAL; > + } > + > return bdrv_co_do_pwritev(bs, sector_num << BDRV_SECTOR_BITS, > nb_sectors << BDRV_SECTOR_BITS, qiov, fl= ags); > } > --=20 > 1.7.9.5 >=20 >=20 Look like you are changing the coroutine version. Some hardware like virtio-blk uses the AIO version of read and writes. What would happen if all the block drivers down the chain are AIO enabled= ? Best regards Beno=EEt