From nobody Mon Feb 9 14:38:10 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1657660860; cv=none; d=zohomail.com; s=zohoarc; b=nSoYQYsk1Q0sVCaiQMYdH2WJnggkZTzxqvKaMZtq+L770Od1RCYx4VUuuYsG895jFB/InCYrAHIisIbh6Ip9vUJFAbTkW7XmYdRXX9DSDUYxlK6BLrfMabzCJllcJEhvj9p0INeVPi9pxBviHSTOrZK7OfTRRqwaFTGAui0gEpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1657660860; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CwFlJAPVPl7sXnM2XXETPNJr8tA5re5ZBNuQxF0Xujg=; b=m3VVA+8KNS2l7Cmfz7oUprY8BJEtkKsRGOLBxbr8FRgIPuhDvucv6ryf8KOtQDEzsCFXVW9zoBPVWqdYl8zWH9rHdEGYxtTvcptbm+zYLd+ZCxew32GY2sgRSmrcOF0jsuXWKquali2GWO9tM/V3/6kKe3uhErAytJ0iDfYKbkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1657660860654893.6002467418768; Tue, 12 Jul 2022 14:21:00 -0700 (PDT) Received: from localhost ([::1]:53856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBNJS-00047Y-BD for importer@patchew.org; Tue, 12 Jul 2022 17:20:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNHv-0001jJ-EE for qemu-devel@nongnu.org; Tue, 12 Jul 2022 17:19:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:21606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBNHr-0002Gj-RM for qemu-devel@nongnu.org; Tue, 12 Jul 2022 17:19:21 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-mSsKEi9kO9mPUutM8hbhog-1; Tue, 12 Jul 2022 17:19:17 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 85E0485A585; Tue, 12 Jul 2022 21:19:16 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 764672166B30; Tue, 12 Jul 2022 21:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657660758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CwFlJAPVPl7sXnM2XXETPNJr8tA5re5ZBNuQxF0Xujg=; b=Vsq6jX38NNjjSk/8OdKnYZICSaYWJtWilD5tiYUw4nYbYd72dDcbwvrY5uva5MnZ9DDDHn m9kuLaj8C6w8feAmDpCXq5gUyI2RihpOcwEcKSrktmi2OSP21gltoVrXOI7V1qh4z74EXR w6a0704Tq/VL/8VwiKwgbIHmq7oR3yk= X-MC-Unique: mSsKEi9kO9mPUutM8hbhog-1 From: Emanuele Giuseppe Esposito To: qemu-devel@nongnu.org Cc: Kevin Wolf , Hanna Reitz , John Snow , Stefan Hajnoczi , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, Emanuele Giuseppe Esposito Subject: [RFC PATCH 1/8] block.c: assert bs->aio_context is written under BQL and drains Date: Tue, 12 Jul 2022 17:19:04 -0400 Message-Id: <20220712211911.1302836-2-eesposit@redhat.com> In-Reply-To: <20220712211911.1302836-1-eesposit@redhat.com> References: <20220712211911.1302836-1-eesposit@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=eesposit@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1657660862922100003 Content-Type: text/plain; charset="utf-8" Also here ->aio_context is read by I/O threads and written under BQL. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Hanna Reitz --- block.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block.c b/block.c index d0db104d71..267a39c0de 100644 --- a/block.c +++ b/block.c @@ -7285,6 +7285,7 @@ static void bdrv_detach_aio_context(BlockDriverState = *bs) if (bs->quiesce_counter) { aio_enable_external(bs->aio_context); } + assert_bdrv_graph_writable(bs); bs->aio_context =3D NULL; } =20 @@ -7298,6 +7299,7 @@ static void bdrv_attach_aio_context(BlockDriverState = *bs, aio_disable_external(new_context); } =20 + assert_bdrv_graph_writable(bs); bs->aio_context =3D new_context; =20 if (bs->drv && bs->drv->bdrv_attach_aio_context) { --=20 2.31.1