public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: kvm@vger.kernel.org
Subject: Re: [ kvm-Bugs-2941282 ] Ubuntu 10.04 installer fails due to I/O errors with virtio
Date: Fri, 29 Jan 2010 15:22:31 -0500	[thread overview]
Message-ID: <20100129202231.GA23315@infradead.org> (raw)
In-Reply-To: <E1NaGEa-0005py-Iv@1bkjzd1.ch3.sourceforge.com>

> Initial Comment:
> I tried installing Ubuntu 10.04 and Fedora 12 in a KVM virtual machine using virtio, on a 8G raw file-backed disk. Both installers failed half-way due to I/O errors. So I tried reproducing it and managed to repeat it 6 times. The bug doesn't occur with IDE emulation. The bug happens fairly quickly with -smp 4 -- usually within 5 minutes -- but is much rarer with -smp 1.
> 
> Ubuntu installer has kernel 2.6.32-11-generic
> Fedora 12 has kernel 2.6.31.5-127.fc12.x86_64
> Host has kernel 2.6.32.6 (Arch Linux) and QEMU 0.12.2

Can you check if the patch below fixes it?

---

From: Christoph Hellwig <hch@lst.de>
Subject: [PATCH v2] block: avoid creating too large iovecs in multiwrite_merge

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.

Add a MAX_IOV defintion for platforms that don't have it.  For now we use
the same 1024 define that's used on Linux and various other platforms,
but until the windows block backend implements some kind of vectored I/O
it doesn't matter.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: qemu/block.c
===================================================================
--- qemu.orig/block.c	2010-01-26 10:59:39.757004445 +0100
+++ qemu/block.c	2010-01-26 11:01:38.056023231 +0100
@@ -1689,6 +1689,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));
Index: qemu/qemu-common.h
===================================================================
--- qemu.orig/qemu-common.h	2010-01-26 14:41:40.894254285 +0100
+++ qemu/qemu-common.h	2010-01-26 14:42:27.267275698 +0100
@@ -54,6 +54,10 @@ struct iovec {
     void *iov_base;
     size_t iov_len;
 };
+/*
+ * Use the same value as Linux for now.
+ */
+#define IOV_MAX		1024
 #else
 #include <sys/uio.h>
 #endif

  reply	other threads:[~2010-01-29 20:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27 22:19 [ kvm-Bugs-2941282 ] Ubuntu 10.04 installer fails due to I/O errors with virtio SourceForge.net
2010-01-29 20:22 ` Christoph Hellwig [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-01-28  0:18 SourceForge.net
2010-01-28 13:26 SourceForge.net
2010-01-28 15:59 SourceForge.net
2010-01-31 20:40 SourceForge.net
2010-03-10 16:30 SourceForge.net
2010-11-26 12:11 SourceForge.net

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=20100129202231.GA23315@infradead.org \
    --to=hch@infradead.org \
    --cc=kvm@vger.kernel.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