From patchwork Mon Jan 6 14:42:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 1218229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="PopviVM4"; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 47rzcJ3pvbz9sPJ for ; Tue, 7 Jan 2020 02:16:16 +1100 (AEDT) Received: from localhost ([::1]:53302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioU73-0005ej-PM for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 10:16:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44566) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioTbw-0007nw-8N for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:44:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioTbv-00016U-37 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:44:04 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42534 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ioTbu-000166-W4 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 09:44:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578321842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+G2RUZx0lySONatlvCEdCYt5JyxyNEJIdc3ZLiAijyY=; b=PopviVM4vwMaqbRfvtgFlZO6kcAsULw74TgCWpFRPn9NTg5s5tnKHwj+VHBuTUc/noeU9J lt9AMpJMCMyYuZUv4jEO91xctHQEfJq40V6a0SjqcKPnDPEdwL+C9GKeGnOsdgKEvB5FPd kJtcRXBXw74SFHohZxt+Zz38+NkZDJk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-371-WCXvJLr8PZiNYHUZAkYJYg-1; Mon, 06 Jan 2020 09:43:56 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 150FB8024DE; Mon, 6 Jan 2020 14:43:55 +0000 (UTC) Received: from localhost (ovpn-117-91.ams2.redhat.com [10.36.117.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 872435D9D6; Mon, 6 Jan 2020 14:43:54 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 34/34] backup-top: Begin drain earlier Date: Mon, 6 Jan 2020 15:42:06 +0100 Message-Id: <20200106144206.698920-35-mreitz@redhat.com> In-Reply-To: <20200106144206.698920-1-mreitz@redhat.com> References: <20200106144206.698920-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: WCXvJLr8PZiNYHUZAkYJYg-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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 , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" When dropping backup-top, we need to drain the node before freeing the BlockCopyState. Otherwise, requests may still be in flight and then the assertion in shres_destroy() will fail. (This becomes visible in intermittent failure of 056.) Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Message-id: 20191219182638.104621-1-mreitz@redhat.com Signed-off-by: Max Reitz --- block/backup-top.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/backup-top.c b/block/backup-top.c index 7cdb1f8eba..818d3f26b4 100644 --- a/block/backup-top.c +++ b/block/backup-top.c @@ -257,12 +257,12 @@ void bdrv_backup_top_drop(BlockDriverState *bs) BDRVBackupTopState *s = bs->opaque; AioContext *aio_context = bdrv_get_aio_context(bs); - block_copy_state_free(s->bcs); - aio_context_acquire(aio_context); bdrv_drained_begin(bs); + block_copy_state_free(s->bcs); + s->active = false; bdrv_child_refresh_perms(bs, bs->backing, &error_abort); bdrv_replace_node(bs, backing_bs(bs), &error_abort);