From patchwork Tue Feb 18 10:07:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fabian_Gr=C3=BCnbichler?= X-Patchwork-Id: 11388163 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E79A14E3 for ; Tue, 18 Feb 2020 10:18:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E26FF207FD for ; Tue, 18 Feb 2020 10:18:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E26FF207FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=proxmox.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:60056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3zxZ-0008Ph-4A for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Feb 2020 05:18:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48870) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3zv7-0002xx-KW for qemu-devel@nongnu.org; Tue, 18 Feb 2020 05:16:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3zv6-0007tZ-Kk for qemu-devel@nongnu.org; Tue, 18 Feb 2020 05:16:01 -0500 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:25357) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j3zv3-0007qM-98; Tue, 18 Feb 2020 05:15:57 -0500 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 486FA41CAA; Tue, 18 Feb 2020 11:08:09 +0100 (CET) From: =?utf-8?q?Fabian_Gr=C3=BCnbichler?= To: qemu-devel@nongnu.org Subject: [RFC qemu 4/6] mirror: switch to bdrv_dirty_bitmap_merge_internal Date: Tue, 18 Feb 2020 11:07:38 +0100 Message-Id: <20200218100740.2228521-5-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200218100740.2228521-1-f.gruenbichler@proxmox.com> References: <20200218100740.2228521-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.186.127.180 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, John Snow , Markus Armbruster , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" since sync_bitmap is busy at the point of merging, and we checked access beforehand. Signed-off-by: Fabian Grünbichler --- block/mirror.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 40d174a625..d6aca2874e 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -735,8 +735,8 @@ static int mirror_exit_common(Job *job) job->ret == 0 && ret == 0)) { /* Success; synchronize copy back to sync. */ bdrv_clear_dirty_bitmap(s->sync_bitmap, NULL); - bdrv_merge_dirty_bitmap(s->sync_bitmap, s->dirty_bitmap, - NULL, &error_abort); + bdrv_dirty_bitmap_merge_internal(s->sync_bitmap, s->dirty_bitmap, + NULL, true); } } bdrv_release_dirty_bitmap(s->dirty_bitmap); @@ -1727,8 +1727,8 @@ static BlockJob *mirror_start_job( } if (s->sync_mode == MIRROR_SYNC_MODE_BITMAP) { - bdrv_merge_dirty_bitmap(s->dirty_bitmap, s->sync_bitmap, - NULL, &local_err); + bdrv_dirty_bitmap_merge_internal(s->dirty_bitmap, s->sync_bitmap, + NULL, true); if (local_err) { goto fail; }