From 78fd7b3d49fd78a2a8ca222dce4247b2de764a54 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 18 Feb 1997 06:46:41 +0000 Subject: [PATCH] Fixed namei caching for LOOKUPs. It was broken for lstat() and olstat(). Successful lstat()s purged an existing entry as well as not caching the result. This bug was introduced in Lite1 by setting the LOCKPARENT flag for [o]lstat() in order to support the inherit-attributes-from-parent- directory misfeature for symlinks. LOCKPARENT was previously only set for CREATEs and DELETEs. It is now set for LOOKUPs, but only for [o]lstat(), so the problem wasn't very noticeable. --- sys/kern/vfs_lookup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 120821d7e877..40f692c67755 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -278,7 +278,8 @@ lookup(ndp) wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE; if (cnp->cn_nameiop == DELETE || - (wantparent && cnp->cn_nameiop != CREATE)) + (wantparent && cnp->cn_nameiop != CREATE && + cnp->cn_nameiop != LOOKUP)) docache = 0; rdonly = cnp->cn_flags & RDONLY; ndp->ni_dvp = NULL;