From patchwork Mon May 11 07:08:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 11539769 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 6F8F381 for ; Mon, 11 May 2020 07:10:54 +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 459D320735 for ; Mon, 11 May 2020 07:10:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=web.de header.i=@web.de header.b="nFILUQ9t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 459D320735 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:56124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jY2aT-00047y-9g for patchwork-qemu-devel@patchwork.kernel.org; Mon, 11 May 2020 03:10:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jY2YA-0001m4-0L; Mon, 11 May 2020 03:08:30 -0400 Received: from mout.web.de ([217.72.192.78]:54235) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jY2Y8-00007v-Uc; Mon, 11 May 2020 03:08:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1589180892; bh=kdZYXdLjb9N8p3xlWxsGNaLfKYEwisH80Lk4OmkVxUI=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=nFILUQ9tVPr7vJUhDwdIoH5wkJySXywYutowTyGxfs0Fzp+FfFKEIZmk+iXMHIclD L+YTaRbSroq9aBOmMUtr3Bwa4/AcuWxPIhjcV0ov9/lVoqghi3Q1R4BeBoduJAM+0N hK+c5vC8IvG+sjH2MoCtDkUZG7XBTf7zEffQ5GbU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from luklap ([89.247.255.192]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MQvsg-1jgBTZ3Yvm-00ULTs; Mon, 11 May 2020 09:08:11 +0200 Date: Mon, 11 May 2020 09:08:01 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH] block/replication.c: Avoid cancelling the job twice Message-ID: <20200511090801.7ed5d8f3@luklap> MIME-Version: 1.0 X-Provags-ID: V03:K1:DWUOH31qynvI8d72VHP7zZ7twTny8RBbbbt1DauTNcuPV9Z/5ao e45UU9vf14ClU/1luvBhsbj7YyUEv7hQnozNzjDZyLIIMyVN2oMdUI3yZqqAgfC948qviDB +dEC/8Kaia9o981lDE/No74Jb/DKSbXOXW/NWuTzbktQYlTWqY6B7r2eSYc04taf3VQxZxc FN6mm2AOEPwejBE4WIeRg== X-UI-Out-Filterresults: notjunk:1;V03:K0:CuPCsJw5j7A=:fps0FunEtkfBiHWQmes0wq 8UIQMYoPZyTNoS7wK6VzGoU5tCXx2gV9WCQYAIOY6DaLf1WKV/zCb126dmvVA83PISmIA/IvY Iezi2OlvOCZkIoddXxXV5zwAJv2/Z6/UiL8RHJzrgmMejAAnOvC0l2+1d2AQ40EPmPYeSwion WLucvjyPTQFOH5tAEXXClnaDtIxkuKAzsVot6m876i+rkCE2Tmsn6Efd2ytSxlNH4xj5Hr2i4 y9vJvExsMctB2IG1LU1Z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=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 03:08:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 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.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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 , Wen Congyang , Xie Changlong , qemu-block , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" If qemu in colo secondary mode is stopped, it crashes because s->backup_job is canceled twice: First with job_cancel_sync_all() in qemu_cleanup() and then in replication_stop(). Fix this by assigning NULL to s->backup_job when the job completes so replication_stop() and replication_do_checkpoint() won't touch the job. Signed-off-by: Lukas Straub --- block/replication.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/replication.c b/block/replication.c index da013c2041..33f2f62a44 100644 --- a/block/replication.c +++ b/block/replication.c @@ -398,6 +398,8 @@ static void backup_job_cleanup(BlockDriverState *bs) BDRVReplicationState *s = bs->opaque; BlockDriverState *top_bs; + s->backup_job = NULL; + top_bs = bdrv_lookup_bs(s->top_id, s->top_id, NULL); if (!top_bs) { return;