From nobody Mon Feb 9 01:49:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1618308151; cv=none; d=zohomail.com; s=zohoarc; b=OVV6fV2OjPgEBRxUgnWHfrgYPcqmWTSVEHAjepLIQ80KcMw/dZAkCs4Zxz8o7S8YM6eqwFQR4+m929+50/QaOJIb2pZfJOZ2f9viRRPNFj8HPeJSvp/fPXo2NVBXZL9ctzKvKaphXOvrJJsMZYahuM7GiIVlbTG/KLu9zzVNFLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618308151; h=Content-Type:Content-Transfer-Encoding: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=AA4vzWMtAWaDRJFIukVSMd+vjfJTBvva7A9WJ3o05lc=; b=Via2lLuNYcUhVnGZ6jQrgY0o6iKmfDGC9ilgqUxFCmQMXITg1/ro2W3U05Hsef2FIqNsElZGfnrutKifB3wcpoIYFo80cPvOs81AAwNYN1j6/5KnMWMKNVEiLHo25anpQbLlQ4E5eGhiUoVd19HyXyZMasYo6KHGFKO0ipHM9hc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618308151184107.64475707104327; Tue, 13 Apr 2021 03:02:31 -0700 (PDT) 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-477-wkLeNIxkMziG36FPDaYEkA-1; Tue, 13 Apr 2021 06:02:27 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E62C8030BB; Tue, 13 Apr 2021 10:02:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C3FF1A870; Tue, 13 Apr 2021 10:02:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C3B3F1806D18; Tue, 13 Apr 2021 10:02:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13DA27Zl011374 for ; Tue, 13 Apr 2021 06:02:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 179C21045E95; Tue, 13 Apr 2021 10:02:07 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C9CF1000324 for ; Tue, 13 Apr 2021 10:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618308149; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AA4vzWMtAWaDRJFIukVSMd+vjfJTBvva7A9WJ3o05lc=; b=EvaB9x9X0VN5ae2pOloB/ve+YjPxFzQPkxFfX5cVAjEiCvbZWzKkb3eCpnO32cPuPlxCmb mGDXOHR2WDd1RwFVKBjIieStdjwoIMU67ii9YdPud0/Pxc+64p7WJi6cMHcrRR6HhIcEnR UIcPq324csWG/eZmXML7nkMDSFfi9Mg= X-MC-Unique: wkLeNIxkMziG36FPDaYEkA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/6] nodedev: Signal initCond with driver locked Date: Tue, 13 Apr 2021 12:01:54 +0200 Message-Id: <7ee86799a8c03be4224ed58a3fef27484ed72795.1618307981.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is more academic dispute than a real bug, but this is taken from pthread_cond_broadcast(3p) man: The pthread_cond_broadcast() or pthread_cond_signal() functions may be called by a thread whether or not it currently owns the mutex that threads calling pthread_cond_wait() or pthread_cond_timedwait() have associated with the condition variable during their waits; however, if predictable scheduling behavior is required, then that mutex shall be locked by the thread calling pthread_cond_broadcast() or pthread_cond_signal(). Therefore, broadcast the initCond while the nodedev driver is still locked. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/node_device/node_device_udev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 44f96f5ff9..20a13211a0 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1986,8 +1986,8 @@ nodeStateInitializeEnumerate(void *opaque) =20 nodeDeviceLock(); driver->initialized =3D true; - nodeDeviceUnlock(); virCondBroadcast(&driver->initCond); + nodeDeviceUnlock(); =20 return; =20 --=20 2.26.3