From nobody Tue Feb 10 19:16:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1645803329; cv=none; d=zohomail.com; s=zohoarc; b=fCfZGAxd5Zr8glSzhMHiLAVzgqP+YHxtctjOxhInVwY/jI/wrALK+ITDu0ogjMt2LruZrmLkH6gpKe7ffXJEi+hvHN7iL7f0BMPnPpbvMrudz/Dr0PuE+bPTUgPvzZYrrmlG1apHz6t9lpRE5/uH840df64OnrJM6Ai19WxhnY0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645803329; 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=iLwjZ/6CITAHSTULSuNjN0vh4yVkAU5cWXDpBAt9ews=; b=Kmo9rA39mKtR6XWQgs0nnbYadGjmAPTOMrSrvhm7mnmy8MIVq8ye0+tpAh/7jema0wCw0Dlb8Ds0Lbb7FTlJ3vW2M3H4NY0VcMP8oSypyS8Qzkiy+clGHx9+3yY23rbVeJhsjENLK/9NHn5R3vSbH5nB42DPzpiCKp0lhVXdJbQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1645803329324820.3506078721151; Fri, 25 Feb 2022 07:35:29 -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-171-eKD1Jbw7P6mRPtIiqotRjg-1; Fri, 25 Feb 2022 10:35:23 -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 86C271091DA2; Fri, 25 Feb 2022 15:35:17 +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 635F47DE2C; Fri, 25 Feb 2022 15:35:17 +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 25C851809CB2; Fri, 25 Feb 2022 15:35:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PFUu7t024497 for ; Fri, 25 Feb 2022 10:30:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0EE3A7C027; Fri, 25 Feb 2022 15:30:56 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (gx270-2.gsslab.fab.redhat.com [10.33.8.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80B967C025; Fri, 25 Feb 2022 15:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645803327; 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=iLwjZ/6CITAHSTULSuNjN0vh4yVkAU5cWXDpBAt9ews=; b=YMSUNbSalCimDBLeCX1NkvXUNGBC15ZpOz0xb2Hq/eN/n3eSqkRGQN3CaAgNI0XNcqGqxA Y+skMeF6v4REvyhJrhE7S7dMQ4GTi9J242T0t3pWNhVrQfgh07QTKSGEUktt2U+jRo9HU0 v81f2Jh4xxK+THvFbIFOeYBelu+j7aM= X-MC-Unique: eKD1Jbw7P6mRPtIiqotRjg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] nwfilter: stop using recursive mutex for IP learning Date: Fri, 25 Feb 2022 15:30:49 +0000 Message-Id: <20220225153053.3241652-2-berrange@redhat.com> In-Reply-To: <20220225153053.3241652-1-berrange@redhat.com> References: <20220225153053.3241652-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645803330395100001 The virNWFilterLockIface method is only called from one place, the learnIPAddressThread method. This is the entry point for the learning thread on the interface in question. As such there is never any recursive locking on this mutex from the same thread. This appears to have been the case since the code was first introduced. Thus a plain mutex is sufficient. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/nwfilter/nwfilter_learnipaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index fb552bd1e6..4840b0539f 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -151,7 +151,7 @@ virNWFilterLockIface(const char *ifname) if (!ifaceLock) { ifaceLock =3D g_new0(virNWFilterIfaceLock, 1); =20 - if (virMutexInitRecursive(&ifaceLock->lock) < 0) { + if (virMutexInit(&ifaceLock->lock) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("mutex initialization failed")); g_free(ifaceLock); --=20 2.35.1