From nobody Thu Nov 24 19:47:19 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NJ7n34SJlz4j0vv; Thu, 24 Nov 2022 19:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NJ7n33t7Vz3vcC; Thu, 24 Nov 2022 19:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669319239; h=from:from: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; bh=AfzFiknqbretQT1N0z9W6ELLHu6btQ9Qrfz4MRepz/o=; b=KH9ZWMOAWIHmCIGQZC7blgAo+jtpCDEfMe9nspz8KRM7+wuUGosfYIXXhFIn+rTSCpMpMW NTOUUdEhGbr9MDile4ZHPIOeJ1l1bXtjsSMNRINzHWvg+HHVxP972O4tOV6731cboDGXyW 9UBquzC75mD+t1Ni3gY7L3jGZ28tzT81HZg2u1dsIBUV4Ht4X1VdIojWNfYaydlnz2eoPM 8zFfApM+4VAV73h6abNT4aFqA0hpSmCisthIdndaxshZxRlCBr8QhLj5TJWjLAP1N8XH2u Xe8yIG4nmxlKcoivLTcYgZdxoB5msQapjKQZcW45pY6sjjawR1dYt9vJqmTkfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669319239; h=from:from: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; bh=AfzFiknqbretQT1N0z9W6ELLHu6btQ9Qrfz4MRepz/o=; b=TkD9nfEFahgEz2J031+2TO0/Qe3PwasMT/fQJ63Wp3kONxmkJlohur1elR/VjYjLC7IIuU +PxE/wj/80Gfx9cBCcfKTQMCeKx+YvMIKpcanl7Sh3OgtolgHSaJSyp6euHAU781D3WTQ0 mjVNCHEY/HbUFQmmWsNbaaA4kOKSrY8ffRJFQvBSTbp1T3qd+jEvTHzgEYVAk6M065ti03 fUWtiMC+JhU2pEt6ZfP2ku1Fz/dLSQNQv4brbUOuBvz9luR9CdtdA4l0Uq1lzDDMTe59pG D0DqSDGCGCkA9VicmGWIIUzikJvjxOCqaQdq1GSvoNnFvfB9GnOlAzmiZ9MgbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669319239; a=rsa-sha256; cv=none; b=f7tucDdPxCsM1BGkGKiWqOn/o34oKkd24h2wBtZJ2d4YX1xAXnfWyQY8L+GOIyufO1GjH1 gXsFmHS3kLWitbaf+tNvsQ+cM25/O3amUMrkTDJ29pcjHgW4yUj9Kgpru3/3BGoj6o0Abz 3aCVe/gQa5zIdVXRXhkbCetAzqB/Slmdqc9kZsRiyUED15JTJELnvS3LBWLw6Ij0YY/6zY Bd+zM8Rr2GNWkYcdn9iVbMZn1iyuwWxgQsAB039knh8UKb3A94hA8j8iTBygL4VaY1idoW YJ+41eXTMzjUAs2VUsrExkws46sM6Q2pxd9cJnGTUS8w9HvwIUeiId4saqjbFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NJ7n32kcxz1Chm; Thu, 24 Nov 2022 19:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AOJlJFX008481; Thu, 24 Nov 2022 19:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AOJlJ6J008480; Thu, 24 Nov 2022 19:47:19 GMT (envelope-from git) Date: Thu, 24 Nov 2022 19:47:19 GMT Message-Id: <202211241947.2AOJlJ6J008480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 3026214ed660 - main - nlm: only access refcounts using dedicated primitives List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3026214ed6607e216148bfe947e847945fd6e1d4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=3026214ed6607e216148bfe947e847945fd6e1d4 commit 3026214ed6607e216148bfe947e847945fd6e1d4 Author: Mateusz Guzik AuthorDate: 2022-11-24 19:25:25 +0000 Commit: Mateusz Guzik CommitDate: 2022-11-24 19:46:43 +0000 nlm: only access refcounts using dedicated primitives Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/nlm/nlm_prot_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/nlm/nlm_prot_impl.c b/sys/nlm/nlm_prot_impl.c index c84d1bffaac5..877eb96a781d 100644 --- a/sys/nlm/nlm_prot_impl.c +++ b/sys/nlm/nlm_prot_impl.c @@ -829,7 +829,7 @@ nlm_create_host(const char* caller_name) if (!host) return (NULL); mtx_init(&host->nh_lock, "nh_lock", NULL, MTX_DEF); - host->nh_refs = 1; + refcount_init(&host->nh_refs, 1); strlcpy(host->nh_caller_name, caller_name, MAXNAMELEN); host->nh_sysid = nlm_next_sysid++; snprintf(host->nh_sysid_string, sizeof(host->nh_sysid_string),