From patchwork Mon Mar 11 10:03:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 226509 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 61DDB2C02B3 for ; Mon, 11 Mar 2013 21:03:58 +1100 (EST) Received: from localhost ([::1]:59928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEzaG-0002G1-DH for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2013 06:03:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEzZx-00025U-14 for qemu-devel@nongnu.org; Mon, 11 Mar 2013 06:03:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEzZq-0008ET-RP for qemu-devel@nongnu.org; Mon, 11 Mar 2013 06:03:36 -0400 Received: from ssl.dlhnet.de ([91.198.192.8]:34624 helo=ssl.dlh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEzZq-0008E7-MA for qemu-devel@nongnu.org; Mon, 11 Mar 2013 06:03:30 -0400 Received: from localhost (localhost [127.0.0.1]) by ssl.dlh.net (Postfix) with ESMTP id 0C07D142F8C; Mon, 11 Mar 2013 11:03:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ssl.dlh.net Received: from ssl.dlh.net ([127.0.0.1]) by localhost (ssl.dlh.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MmfSOtPqy-oN; Mon, 11 Mar 2013 11:03:28 +0100 (CET) Received: from [172.21.12.60] (unknown [82.141.1.226]) by ssl.dlh.net (Postfix) with ESMTPSA id BEA9213FA74; Mon, 11 Mar 2013 11:03:28 +0100 (CET) Message-ID: <513DABF0.7010906@dlhnet.de> Date: Mon, 11 Mar 2013 11:03:28 +0100 From: Peter Lieven User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: "qemu-devel@nongnu.org" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 91.198.192.8 Cc: Kevin Wolf , Paolo Bonzini , Jeff Cody , Anthony Liguori Subject: [Qemu-devel] [PATCH 1/3] Revert "block: complete all IOs before .bdrv_truncate" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org brdv_truncate() is also called from readv/writev commands on self- growing file based storage. this will result in requests waiting for theirselves to complete. This reverts commit 9a665b2b8640e464f0a778216fc2dca8d02acf33. --- block.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block.c b/block.c index 124a9eb..60c246a 100644 --- a/block.c +++ b/block.c @@ -2449,10 +2449,6 @@ int bdrv_truncate(BlockDriverState *bs, int64_t offset) return -EACCES; if (bdrv_in_use(bs)) return -EBUSY; - - /* There better not be any in-flight IOs when we truncate the device. */ - bdrv_drain_all(); - ret = drv->bdrv_truncate(bs, offset); if (ret == 0) { ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);