From patchwork Thu Sep 15 14:53:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 9334039 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 CEB6E601C2 for ; Thu, 15 Sep 2016 15:18:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0D1129939 for ; Thu, 15 Sep 2016 15:18:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B549429947; Thu, 15 Sep 2016 15:18:02 +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 9020E29939 for ; Thu, 15 Sep 2016 15:18:00 +0000 (UTC) Received: from localhost ([::1]:35434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkYQJ-0001Pi-LG for patchwork-qemu-devel@patchwork.kernel.org; Thu, 15 Sep 2016 11:17:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkY30-0006ef-Fl for qemu-devel@nongnu.org; Thu, 15 Sep 2016 10:53:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkY2x-0003TN-HD for qemu-devel@nongnu.org; Thu, 15 Sep 2016 10:53:53 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:36249 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkY2x-0003Ss-81; Thu, 15 Sep 2016 10:53:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2A9AwBotdpX/5tjdVtcHAEBBAEBCgEBgzoBAQEBAR6BU40zlXMBAQEBAQEFAYESAZIHgg+CA4YeAoFbOBQBAgEBAQEBAQFeJ4RiAgR5ED8SPBsZiE4BwXIBMIVpgkmHWoUQBY8hikeJJ4Yyj2VIkBEeNoIuTxuBUm2HAQEBAQ X-IPAS-Result: A2A9AwBotdpX/5tjdVtcHAEBBAEBCgEBgzoBAQEBAR6BU40zlXMBAQEBAQEFAYESAZIHgg+CA4YeAoFbOBQBAgEBAQEBAQFeJ4RiAgR5ED8SPBsZiE4BwXIBMIVpgkmHWoUQBY8hikeJJ4Yyj2VIkBEeNoIuTxuBUm2HAQEBAQ X-IronPort-AV: E=Sophos;i="5.30,339,1470693600"; d="scan'208";a="189830357" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 15 Sep 2016 16:53:24 +0200 Received: from a88-114-146-42.elisa-laajakaista.fi ([88.114.146.42] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim) id 1bkY2V-0007dK-Lr; Thu, 15 Sep 2016 16:53:24 +0200 Received: from berto by perseus.local with local (Exim 4.87) (envelope-from ) id 1bkY2I-00009f-9X; Thu, 15 Sep 2016 17:53:10 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Thu, 15 Sep 2016 17:53:04 +0300 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Subject: [Qemu-devel] [PATCH v2 6/7] commit: Add 'base' to the reopen queue before 'overlay_bs' 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: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Now that we're checking for duplicates in the reopen queue, there's no need to force a specific order in which the queue is constructed so we can revert 3db2bd5508c86a1605258bc77c9672d93b5c350e. Since both ways of constructing the queue are now valid, this patch doesn't have any effect on the behavior of QEMU and is not strictly necessary. However it can help us check that the fix for the reopen queue is robust: if it stops working properly at some point, iotest 040 will break. Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block/commit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/commit.c b/block/commit.c index 553e18d..3ab5e0c 100644 --- a/block/commit.c +++ b/block/commit.c @@ -243,14 +243,14 @@ void commit_start(const char *job_id, BlockDriverState *bs, orig_overlay_flags = bdrv_get_flags(overlay_bs); /* convert base & overlay_bs to r/w, if necessary */ - if (!(orig_overlay_flags & BDRV_O_RDWR)) { - reopen_queue = bdrv_reopen_queue(reopen_queue, overlay_bs, NULL, - orig_overlay_flags | BDRV_O_RDWR); - } if (!(orig_base_flags & BDRV_O_RDWR)) { reopen_queue = bdrv_reopen_queue(reopen_queue, base, NULL, orig_base_flags | BDRV_O_RDWR); } + if (!(orig_overlay_flags & BDRV_O_RDWR)) { + reopen_queue = bdrv_reopen_queue(reopen_queue, overlay_bs, NULL, + orig_overlay_flags | BDRV_O_RDWR); + } if (reopen_queue) { bdrv_reopen_multiple(reopen_queue, &local_err); if (local_err != NULL) {