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.
This commit is contained in:
Bruce Evans 1997-02-18 06:46:41 +00:00
parent a88368cfdf
commit 78fd7b3d49
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22874

View File

@ -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;