summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-02-18 06:46:41 +0000
committerbde <bde@FreeBSD.org>1997-02-18 06:46:41 +0000
commita962df746e20e0ea1b42533fa31cdeb9f53604c3 (patch)
tree7afcd17a08c63bc14ace9e156d83e02a89fff3fe /sys
parent8feba284f5142f7caa4edaccb190cdce819fc48b (diff)
downloadFreeBSD-src-a962df746e20e0ea1b42533fa31cdeb9f53604c3.zip
FreeBSD-src-a962df746e20e0ea1b42533fa31cdeb9f53604c3.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_lookup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 120821d..40f692c 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;
OpenPOWER on IntegriCloud