From patchwork Sun Jul 18 14:48:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 12384371 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.5 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 B7ECBC636CA for ; Sun, 18 Jul 2021 14:50:03 +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 557BE61183 for ; Sun, 18 Jul 2021 14:50:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 557BE61183 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]:37380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m587G-0007G5-5v for qemu-devel@archiver.kernel.org; Sun, 18 Jul 2021 10:50:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m585z-00053J-CU; Sun, 18 Jul 2021 10:48:43 -0400 Received: from mout.web.de ([212.227.15.14]:57869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m585x-0006ZZ-JB; Sun, 18 Jul 2021 10:48:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1626619702; bh=Q03+B0T1J5eUR8OCQrPZOF1g/Ny8TGdTKin3Aui9/IQ=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=C/1FUK949sIG+VeNbnUmJHi4/wwkLp9BlLOeApEt/XpBSJUdVo1jMxdRT8/y19M3I PS4vN3d8m6xtX2l00xtUpHTxAPm1y8BwyrNaCNZeYtRts5Xvw4kga7fnyJF3c2FOu0 BJadoJgDKFLHE4/loW2gx82h1ixJLltsL661MH6c= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from gecko.fritz.box ([89.247.255.49]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MjgXH-1lQFUT1jzv-00lGkf; Sun, 18 Jul 2021 16:48:22 +0200 Date: Sun, 18 Jul 2021 16:48:02 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH v6 0/4] replication: Bugfix and properly attach children Message-ID: MIME-Version: 1.0 X-Provags-ID: V03:K1:Bn44d3xZdAo1tNMYBtujHwj78nvDoc3Ua+oaOfYr1e1xC1f5aLt WwtJJf51hqI61165Yuo6zQVeR0MmhTdz5/gFoqvE297+upWH3viwhmlZRq8sCaCnQaSpie8 282B0mTJg7KxEuhy5ow2rXDp1I8rAy7EZHhw5utveh+ZZW9lJX3V9rifEYJLe/ZXnOEJLHB VKd290Y2QAiXlSekEnxVQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Q1yJ0vGR+Tk=:i9c7ucPPgadaARhi9aO/AQ 18imusGwcSxPW8OPbtFpYNf+JJg/+8JRPbmj+pfQECoZQ22lcSifCXTyq/48p5OxJixFcscPO yYQ5fjn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212.227.15.14; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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: -v6: -Drop "replication: Assert that children are writable" -Added Reviewed-by tags -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 (4): replication: Remove s->active_disk replication: Reduce usage of s->hidden_disk and s->secondary_disk replication: Properly attach children replication: Remove workaround block/replication.c | 111 +++++++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 43 deletions(-) --- 2.20.1