From owner-dev-commits-src-branches@freebsd.org Thu Mar 4 20:08:51 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 606F2558322; Thu, 4 Mar 2021 20:08:51 +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 4Ds24d5gNyz4qZ7; Thu, 4 Mar 2021 20:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 34A7D234C7; Thu, 4 Mar 2021 20:08:48 +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 124K8lMh042013; Thu, 4 Mar 2021 20:08:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 124K8lWo042012; Thu, 4 Mar 2021 20:08:47 GMT (envelope-from git) Date: Thu, 4 Mar 2021 20:08:47 GMT Message-Id: <202103042008.124K8lWo042012@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4a5108cdc927 - releng/13.0 - nameicap_tracker_add: avoid duplicates in the tracker list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 4a5108cdc92795ff035758a79b09cd0376ecec12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2021 20:08:55 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4a5108cdc92795ff035758a79b09cd0376ecec12 commit 4a5108cdc92795ff035758a79b09cd0376ecec12 Author: Konstantin Belousov AuthorDate: 2021-02-28 00:13:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-03-04 20:07:54 +0000 nameicap_tracker_add: avoid duplicates in the tracker list Approved by: re (gjb) (cherry picked from commit 2388ad7c293fbc89ee239a1adcb87fd158c4e8e9) --- sys/kern/vfs_lookup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 73290e8da05f..cdd4a914239f 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -182,6 +182,9 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp) if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR) return; cnp = &ndp->ni_cnd; + nt = TAILQ_LAST(&ndp->ni_cap_tracker, nameicap_tracker_head); + if (nt != NULL && nt->dp == dp) + return; nt = malloc(sizeof(*nt), M_NAMEITRACKER, M_WAITOK); vhold(dp); nt->dp = dp;