From: Avi Kivity Subject: [PATCH +stable] block: don't attempt to merge overlapping requests Date: Tue, 18 May 2010 20:18:44 +0300 Message-ID: <1274203124-14318-1-git-send-email-avi@redhat.com> Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org To: Kevin Wolf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32373 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757669Ab0ERRSt (ORCPT ); Tue, 18 May 2010 13:18:49 -0400 Sender: kvm-owner@vger.kernel.org List-ID: The block multiwrite code pretends to be able to merge overlapping requests, but doesn't do so in fact. This leads to I/O errors (for example on mkfs of a large virtio disk). Signed-off-by: Avi Kivity --- block.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 48305b7..0e44e26 100644 --- a/block.c +++ b/block.c @@ -1956,8 +1956,8 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs, int64_t oldreq_last = reqs[outidx].sector + reqs[outidx].nb_sectors; // This handles the cases that are valid for all block drivers, namely - // exactly sequential writes and overlapping writes. - if (reqs[i].sector <= oldreq_last) { + // exactly sequential writes + if (reqs[i].sector == oldreq_last) { merge = 1; } -- 1.6.6.1