Date: Sun, 21 Mar 2021 17:55:14 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 512efd236cb1 - stable/12 - nameicap_tracker_add: avoid duplicates in the tracker list Message-ID: <202103211755.12LHtEss031664@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=512efd236cb1aeeac591b1e5701fb1fe26d91a22 commit 512efd236cb1aeeac591b1e5701fb1fe26d91a22 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-02-28 00:13:19 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-03-21 17:54:21 +0000 nameicap_tracker_add: avoid duplicates in the tracker list Tested by: pho (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 cc0fe415365a..84a40d9e8fec 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -179,6 +179,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 = uma_zalloc(nt_zone, M_WAITOK); vhold(dp); nt->dp = dp;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103211755.12LHtEss031664>