From patchwork Thu May 19 15:21:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 9127851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB01560453 for ; Thu, 19 May 2016 15:38:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEC7328102 for ; Thu, 19 May 2016 15:38:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3D51281CF; Thu, 19 May 2016 15:38:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6ADFD28102 for ; Thu, 19 May 2016 15:38:27 +0000 (UTC) Received: from localhost ([::1]:51010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Q1p-0002X8-U3 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 May 2016 11:38:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3PmY-0005Ee-Gu for qemu-devel@nongnu.org; Thu, 19 May 2016 11:22:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3PmU-00009Q-E5 for qemu-devel@nongnu.org; Thu, 19 May 2016 11:22:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3PmL-0008SM-Tm; Thu, 19 May 2016 11:22:26 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E820C04B313; Thu, 19 May 2016 15:22:25 +0000 (UTC) Received: from noname.str.redhat.com. (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4JFMEAx025145; Thu, 19 May 2016 11:22:24 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 19 May 2016 17:21:48 +0200 Message-Id: <1463671329-22655-11-git-send-email-kwolf@redhat.com> In-Reply-To: <1463671329-22655-1-git-send-email-kwolf@redhat.com> References: <1463671329-22655-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 19 May 2016 15:22:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/31] block/io: Quiesce parents between drained_begin/end X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP So far, bdrv_parent_drained_begin/end() was called for the duration of the actual bdrv_drain() at the beginning of a drained section, but we really should keep parents quiesced until the end of the drained section. This does not actually change behaviour at this point because the only user of the .drained_begin/end BdrvChildRole callback is I/O throttling, which already doesn't send any new requests after flushing its queue in .drained_begin. The patch merely removes a trap for future users. Reported-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf Acked-by: Stefan Hajnoczi --- block/io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/io.c b/block/io.c index 7c213ec..23abbc5 100644 --- a/block/io.c +++ b/block/io.c @@ -2749,11 +2749,14 @@ void bdrv_drained_begin(BlockDriverState *bs) if (!bs->quiesce_counter++) { aio_disable_external(bdrv_get_aio_context(bs)); } + bdrv_parent_drained_begin(bs); bdrv_drain(bs); } void bdrv_drained_end(BlockDriverState *bs) { + bdrv_parent_drained_end(bs); + assert(bs->quiesce_counter > 0); if (--bs->quiesce_counter > 0) { return;