The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2388ad7c293fbc89ee239a1adcb87fd158c4e8e9

commit 2388ad7c293fbc89ee239a1adcb87fd158c4e8e9
Author:     Konstantin Belousov <k...@freebsd.org>
AuthorDate: 2021-02-28 00:13:19 +0000
Commit:     Konstantin Belousov <k...@freebsd.org>
CommitDate: 2021-03-02 18:21:23 +0000

    nameicap_tracker_add: avoid duplicates in the tracker list
    
    Reviewed by:    markj
    Tested by:      arichardson, pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D28907
---
 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;
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to