From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXbyt-0000ri-MT for qemu-devel@nongnu.org; Wed, 20 Jan 2010 09:56:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXbyt-0000r0-3B for qemu-devel@nongnu.org; Wed, 20 Jan 2010 09:56:27 -0500 Received: from [199.232.76.173] (port=54378 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXbyt-0000qr-0Y for qemu-devel@nongnu.org; Wed, 20 Jan 2010 09:56:27 -0500 Received: from qw-out-1920.google.com ([74.125.92.145]:55210) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXbys-00042e-IS for qemu-devel@nongnu.org; Wed, 20 Jan 2010 09:56:26 -0500 Received: by qw-out-1920.google.com with SMTP id 4so180798qwk.4 for ; Wed, 20 Jan 2010 06:56:26 -0800 (PST) Message-ID: <4B571997.8050603@codemonkey.ws> Date: Wed, 20 Jan 2010 08:56:23 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] block: prevent multiwrite_merge from creating too large iovecs References: <20100119211539.GA4383@lst.de> In-Reply-To: <20100119211539.GA4383@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig Cc: qemu-devel@nongnu.org On 01/19/2010 03:15 PM, Christoph Hellwig wrote: > If we go over the maximum number of iovecs support by syscall we get > back EINVAL from the kernel which translate to I/O errors for the guest. > > Signed-off-by: Christoph Hellwig > Applied. Thanks. Regards, Anthony Liguori > Index: qemu/block.c > =================================================================== > --- qemu.orig/block.c 2010-01-19 22:10:19.797003226 +0100 > +++ qemu/block.c 2010-01-19 22:11:08.226005767 +0100 > @@ -1711,6 +1711,10 @@ static int multiwrite_merge(BlockDriverS > merge = bs->drv->bdrv_merge_requests(bs,&reqs[outidx],&reqs[i]); > } > > + if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1> IOV_MAX) { > + merge = 0; > + } > + > if (merge) { > size_t size; > QEMUIOVector *qiov = qemu_mallocz(sizeof(*qiov)); > > > >