From patchwork Mon Jul 12 11:53:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 12370809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F9A1C07E99 for ; Mon, 12 Jul 2021 11:56:02 +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 CC31861004 for ; Mon, 12 Jul 2021 11:56:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC31861004 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2uXY-00030R-UV for qemu-devel@archiver.kernel.org; Mon, 12 Jul 2021 07:56:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2uVx-0000C1-Sg; Mon, 12 Jul 2021 07:54:21 -0400 Received: from mout.web.de ([212.227.17.11]:37947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2uVv-0005si-01; Mon, 12 Jul 2021 07:54:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1626090836; bh=SrKnKGOgvI622OS+2EnMYSbrR55yLKHVPkeiRtM527w=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=DqB8OHPfoGA9bwGiX97GeyInRenJohtOPK7ws95MXMbqisPJzjlvCtFD5VNRF2niQ /5Y2gJbbp7WzwE7MCWmwP62qaFFBBZTCp5AftlC+9qxS1u+2M1XyYdc7EdipPrKyfS msDXWtFLil66uXr1Zs5L5d1XRPlRpF4KbsiqcnyM= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from gecko.fritz.box ([88.130.61.76]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MLgQp-1m3jii41fn-000tdm; Mon, 12 Jul 2021 13:53:56 +0200 Date: Mon, 12 Jul 2021 13:53:39 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v5 0/5] replication: Bugfix and properly attach children Message-ID: MIME-Version: 1.0 X-Provags-ID: V03:K1:tnKpFkfLwPefVpfBtpZufVpsvivhDNupTX9g830rivnRlFQpUHc 47AA/Mkwdj4b3FqbZxO6XmYaXdIfj+ZwGhu5cOEXSTRDtT7l5v0wEzk0qNSVEOHOBYBJIBe 8YhW5k9ZEeiErI+otOCZ+i0Hchh1LYy4UUpjlZ8K9zHh6mvb0vfDXNe7JUjM0RX2uP2WSwG 6F7hvUUzDlEhaM5Ds3GDQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:66WKzlEz3ZY=:858ykr+dOcR4DQ4TnKO6UX XgO7s+nlT10MdC5DOfZ8qDnh9HVUxyYzgYMO8sxJWu4/zEG3pb3oUsuLtarmejY5zOd5Lekz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ip=212.227.17.11; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 , Vladimir Sementsov-Ogievskiy , qemu-block , Wen Congyang , Xie Changlong , Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hello Everyone, A while ago Kevin noticed that the replication driver doesn't properly attach the children it wants to use. Instead, it directly copies the BdrvChilds from it's backing file, which is wrong. Ths Patchset fixes the problem, fixes a potential crash in replication_co_writev due to missing permissions and removes a workaround that was put in place back then. Tested with full COLO-migration setup in my COLO testsuite. Regards, Lukas Straub Changes: -v5: -Assert that children are writable where it's needed -v4: -minor style fixes -clarify why children areguaranteed to be writable in "replication: Remove workaround" -Added Reviewed-by tags -v3: -Split up into multiple patches -Remove s->active_disk -Clarify child permissions in commit message -v2: Test for BDRV_CHILD_PRIMARY in replication_child_perm, since bs->file might not be set yet. (Vladimir) Lukas Straub (5): replication: Remove s->active_disk replication: Reduce usage of s->hidden_disk and s->secondary_disk replication: Properly attach children replication: Assert that children are writable replication: Remove workaround block/replication.c | 121 ++++++++++++++++++++++++++++---------------- 1 file changed, 78 insertions(+), 43 deletions(-) --- 2.20.1