From patchwork Mon Mar 11 10:05:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Lieven X-Patchwork-Id: 226511 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 6AAB42C02B2 for ; Mon, 11 Mar 2013 21:05:42 +1100 (EST) Received: from localhost ([::1]:34625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEzbw-0003tc-KV for incoming@patchwork.ozlabs.org; Mon, 11 Mar 2013 06:05:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEzbf-0003tC-Dt for qemu-devel@nongnu.org; Mon, 11 Mar 2013 06:05:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UEzbY-0000id-J7 for qemu-devel@nongnu.org; Mon, 11 Mar 2013 06:05:23 -0400 Received: from ssl.dlhnet.de ([91.198.192.8]:34650 helo=ssl.dlh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UEzbY-0000i2-DS for qemu-devel@nongnu.org; Mon, 11 Mar 2013 06:05:16 -0400 Received: from localhost (localhost [127.0.0.1]) by ssl.dlh.net (Postfix) with ESMTP id 0B6E7142F8C; Mon, 11 Mar 2013 11:05:16 +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 zQxos3rjA9ws; Mon, 11 Mar 2013 11:05:15 +0100 (CET) Received: from [172.21.12.60] (unknown [82.141.1.226]) by ssl.dlh.net (Postfix) with ESMTPSA id B678A13FA74; Mon, 11 Mar 2013 11:05:15 +0100 (CET) Message-ID: <513DAC5B.5000607@dlhnet.de> Date: Mon, 11 Mar 2013 11:05:15 +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 3/3] iscsi_truncate: ensure there are no requests in flight 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 ensure that there are no pending I/Os before calling the sync readcapacity commands. the block_resize monitor command will also flush all I/O, but double check in case iscsi_truncate() is called from elsewhere in the future. Signed-off-by: Peter Lieven --- block/iscsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 3d52921..de20d53 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1167,6 +1167,10 @@ static int iscsi_truncate(BlockDriverState *bs, int64_t offset) return -ENOTSUP; } + /* ensure all async requests are completed before executing + * a sync readcapacity */ + bdrv_drain_all(); + if ((ret = iscsi_readcapacity_sync(iscsilun)) != 0) { return ret; }