From patchwork Tue May 18 17:18:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 100555 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4IHIs5r028800 for ; Tue, 18 May 2010 17:18:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758457Ab0ERRSu (ORCPT ); Tue, 18 May 2010 13:18:50 -0400 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 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4IHIlfS014861 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 May 2010 13:18:47 -0400 Received: from localhost.localdomain (vpn-6-58.tlv.redhat.com [10.35.6.58]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4IHIjUQ010516; Tue, 18 May 2010 13:18:46 -0400 From: Avi Kivity To: Kevin Wolf Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 18 May 2010 17:18:54 +0000 (UTC) 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; }