From nobody Mon Feb 9 14:16:54 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=1682069907; cv=none; d=zohomail.com; s=zohoarc; b=MXvPhxYpOO2GWJ+MOq6fiBZyKEFnRN1eFfyXPdNXE7deQBnJgbqwBB1fOLAtQQ/wW9DQyYc0P67zz1GDbTOqr1+LRpSwYW+YBVKEmI1mn7KUod5nb7xkUw2jBO1kXMDZwNA0jHOwntLpw+J4Vwvsc4IIF4E+JoSBK/fuJknVYsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682069907; h=Content-Type: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=okad+PcFVQMByyo2KeLFQxi04FPrrcM5w65u5q8ERwU=; b=bTOldeKF1l+738SfS48NFm7GRTp0/3JLMDS4boEcS3xtPESHF4Y02EyqsJJSU3QxNHQPLlteayMtAKUITx0aPqb1LANPr69kxHPglbhytrDVJUmrdTwXYgS1KVMonNb5ftnvI67qSpIs4t/tUiRyqSbBB9O3SnqFtfS+Gr6t2w8= 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 1682069907382369.84095453313637; Fri, 21 Apr 2023 02:38:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppn9R-0008WT-Od; Fri, 21 Apr 2023 05:33:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppn9P-0008UW-Md for qemu-devel@nongnu.org; Fri, 21 Apr 2023 05:33:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppn9N-00035B-EI for qemu-devel@nongnu.org; Fri, 21 Apr 2023 05:33:55 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-643-3c76D2ArPrKW-uN5X6moMg-1; Fri, 21 Apr 2023 05:33:48 -0400 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-506a455ee4cso1360640a12.3 for ; Fri, 21 Apr 2023 02:33:48 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.gmail.com with ESMTPSA id w2-20020a1709067c8200b0094f2d38896esm1834463ejo.65.2023.04.21.02.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 02:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682069630; 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=okad+PcFVQMByyo2KeLFQxi04FPrrcM5w65u5q8ERwU=; b=N7EqmnxOOF8q54cQWTjQpCLrBz0vAw7GQJXCrWGLe4jzeM0vLtRSm2OhSL04czYw0Uqb2m Wn1mI8Nz7G7QGEZ5bBIsMjn0fw8jiXRaJRjR7rxbzqrjQDy29YIsybMQPzeTgLm1iXvTRS GpMLxGYFcKgYi4bTe1WlYVQx4niq8bY= X-MC-Unique: 3c76D2ArPrKW-uN5X6moMg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682069627; x=1684661627; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=okad+PcFVQMByyo2KeLFQxi04FPrrcM5w65u5q8ERwU=; b=l+3CynzxvGVscIWz0HaAnRTAQtORNIBNzk0u2oLbZ/iypsi9D/lzlizBMpWNQJiXHd OMvNcDBTemAwKzQ+KF8X2vWBAV7irsv5mo+aeLGwidTpiIyfnhpwKxfWJMLk13BgZxRf kAJwutsczT3D4uDCfKwtAtKzEW11jqEAnYKeZ7lZFsSUwGpai27cXay8v5Ikepb3Mxpz 8MiB2m7rD201ttKrtOYFY93R7MnCqfd38ivp2/3wbhXGer1ZsGJP/mkkd7jcyzwIfu0E GHOAUNKXgsezySCw59hNk0O7hApxDgvmfvD6NNLGnXd8zh8GfM2XMVpKRJmGww5agarb m2LQ== X-Gm-Message-State: AAQBX9eWCyH07AlmsRtP3FQTa4SUx1LpX5prnabyYjjnSK7y7+BpB8NR zxMKqETvq/MQjYweYh3s41o3wh4dDQAnhUI9Mw3ZIZuoILfNlnSe4zIhvQB8U0ULcb9X0Nvcb7U KrgNtyWkXhRT9Emk8PZtbrG9X5a8UOqUcYqBd16IIv7C/XBcapAwHBlcK+CsxUXOGkc7d1hUEuS aZRQ== X-Received: by 2002:a17:907:1003:b0:94f:49a2:619a with SMTP id ox3-20020a170907100300b0094f49a2619amr1705963ejb.11.1682069627241; Fri, 21 Apr 2023 02:33:47 -0700 (PDT) X-Google-Smtp-Source: AKy350Z0+ZSQQubXyXi7UGvvd0FDTZC94HOULxEPikGy5XeY1+tnnz2HKJnbQaUw8OWAZT5avzKskg== X-Received: by 2002:a17:907:1003:b0:94f:49a2:619a with SMTP id ox3-20020a170907100300b0094f49a2619amr1705949ejb.11.1682069626891; Fri, 21 Apr 2023 02:33:46 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Eric Blake Subject: [PULL 21/25] nbd: a BlockExport always has a BlockBackend Date: Fri, 21 Apr 2023 11:33:12 +0200 Message-Id: <20230421093316.17941-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230421093316.17941-1-pbonzini@redhat.com> References: <20230421093316.17941-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1682069909280100003 Content-Type: text/plain; charset="utf-8" exp->common.blk cannot be NULL, nbd_export_delete() is only called (through a bottom half) from blk_exp_unref() and in turn that can only happen after blk_exp_add() has asserted exp->blk !=3D NULL. Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- nbd/server.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 3d8d0d81df22..4f5c42f84d9e 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1847,15 +1847,13 @@ static void nbd_export_delete(BlockExport *blk_exp) g_free(exp->description); exp->description =3D NULL; =20 - if (exp->common.blk) { - if (exp->eject_notifier_blk) { - notifier_remove(&exp->eject_notifier); - blk_unref(exp->eject_notifier_blk); - } - blk_remove_aio_context_notifier(exp->common.blk, blk_aio_attached, - blk_aio_detach, exp); - blk_set_disable_request_queuing(exp->common.blk, false); + if (exp->eject_notifier_blk) { + notifier_remove(&exp->eject_notifier); + blk_unref(exp->eject_notifier_blk); } + blk_remove_aio_context_notifier(exp->common.blk, blk_aio_attached, + blk_aio_detach, exp); + blk_set_disable_request_queuing(exp->common.blk, false); =20 for (i =3D 0; i < exp->nr_export_bitmaps; i++) { bdrv_dirty_bitmap_set_busy(exp->export_bitmaps[i], false); --=20 2.40.0