From nobody Sun Feb 8 23:26:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1643726638; cv=none; d=zohomail.com; s=zohoarc; b=RpA+Gt1QZ1xl9XhByxU/oXhG7oIuFKT/zzO79mYtb8IVVRtJs1v3xDexDUmBsE+Qu6SJRqvOludLcH/eWnkumjGrDcYhnj/RuiEqUueNsEPDgS3XTVMRqSL3WvdYnPYB0RwvjkcRQyi0Vbsw41roZROwpJsHocxkApVMzrfFkKc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643726638; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=BNXxj0IoZehHnuU0UaXlBLQZps2YroYG/bOLi1IGEEo=; b=fD8U5AE3SG0iRhGyIjvH3pxFMwnJvuD1LRG0jqRdPiu6KBO2l8hhYQLFPhLMOi12dx2gnU+fGBNfLIhOwt4+RHLu/FAmh/Dvnhk82CYATlu2oI5JtrcKjuEQAFZTyp/5i2665axCTMk2QQIaTRd5np8u4Ts7kZm3wQTzDfm8RlY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1643726638337565.8909034641149; Tue, 1 Feb 2022 06:43:58 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-570-4ZeQDVHSPUO4U5rd0fKl8A-1; Tue, 01 Feb 2022 09:43:56 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D42948144E5; Tue, 1 Feb 2022 14:43:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B2DF47DE23; Tue, 1 Feb 2022 14:43:50 +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 843664A7C9; Tue, 1 Feb 2022 14:43:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 211EhmCZ016445 for ; Tue, 1 Feb 2022 09:43:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id C441070D2B; Tue, 1 Feb 2022 14:43:48 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id 460035DBB7 for ; Tue, 1 Feb 2022 14:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643726637; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=BNXxj0IoZehHnuU0UaXlBLQZps2YroYG/bOLi1IGEEo=; b=RyBn+TpOW48IObveVKEPP+eLYaeCZeG0juxXK9bEuQW2Rm214HrZRJdnL9257BsyyQKxk2 oKB4hRj8UHuPG2rtX0EickQrvi6JMorop3HSCZe73BshSLgVPwdCuqsyZC8/wegjyjOCQM EvN/QuYEPevSC4Q/3DZj0q2f5PqydUc= X-MC-Unique: 4ZeQDVHSPUO4U5rd0fKl8A-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virnodedeviceobj: Don't unlock virNodeDeviceObj in virNodeDeviceObjListRemove() Date: Tue, 1 Feb 2022 15:43:46 +0100 Message-Id: <5b3bad6f05ddc46ed5c808677aa34b2e22b7af8c.1643726626.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.79 on 10.5.11.16 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) X-ZM-MESSAGEID: 1643726639823100001 Content-Type: text/plain; charset="utf-8" When virNodeDeviceObjListRemove() is called, the passed virNodeDeviceObj is removed from internal list of node devices and then unrefed and unlocked. While the former is warranted (the object was refed at the beginning of the function) the unlock is not. In fact, it's wrong from conceptual POV. We still want threads working on the object tu mutually exclude each other. Signed-off-by: Michal Privoznik --- src/conf/virnodedeviceobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index 2e4ef2df3c..7a560349d4 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -524,7 +524,7 @@ virNodeDeviceObjListRemove(virNodeDeviceObjList *devs, virObjectRWLockWrite(devs); virObjectLock(obj); virNodeDeviceObjListRemoveLocked(devs, obj); - virNodeDeviceObjEndAPI(&obj); + virObjectUnref(obj); virObjectRWUnlock(devs); } =20 --=20 2.34.1