Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 1997 06:50:02 -0800 (PST)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs
Subject:   Re: kern/2635: NFS cache and access permissions.
Message-ID:  <199702021450.GAA20595@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/2635; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: dwmalone@maths.tcd.ie, FreeBSD-gnats-submit@FreeBSD.ORG
Cc: iedowse@maths.tcd.ie, mpp@FreeBSD.ORG
Subject: Re: kern/2635: NFS cache and access permissions.
Date: Mon, 3 Feb 1997 01:38:39 +1100

 >	For some reason lstat'ing a file in the directory in question
 >	seems to invalidate the cache.
 
 I fixed this locally a year or two ago, but no one (except Terry :-)
 seemed interested in reviewing my patch or fixing it properly.  It was
 broken in 4.4Lite to support symlinks inheriting attributes from the
 parent directory.  I forget what the penalty for invalidating the
 cache is.
 
 Bruce
 
 diff -c2 vfs_lookup.c~ vfs_lookup.c
 *** vfs_lookup.c~	Wed Jan 15 05:06:10 1997
 --- vfs_lookup.c	Wed Jan 15 05:06:11 1997
 ***************
 *** 276,281 ****
   	wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT);
   	docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE;
   	if (cnp->cn_nameiop == DELETE ||
 ! 	    (wantparent && cnp->cn_nameiop != CREATE))
   		docache = 0;
   	rdonly = cnp->cn_flags & RDONLY;
 --- 273,290 ----
   	wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT);
   	docache = (cnp->cn_flags & NOCACHE) ^ NOCACHE;
 + 	/*
 + 	 * XXX the following seems to be just to recover from not setting
 + 	 * NOCACHE for the DELETE cases (unlink, rmdir and the rename
 + 	 * source).  In BSD4.4lite[2], docache was also cleared for the
 + 	 * (wantparent && cnp->cn_nameiop == LOOKUP) case.  This case
 + 	 * seems to only occur for lstat and olstat, when it is wrong
 + 	 * to clear docache.  This case probably didn't occur before
 + 	 * BSD4.4lite.  LOCKPARENT was introduced for lstat to support
 + 	 * the new behaviour of symlinks (attributes inherited from the
 + 	 * parent.
 + 	 */
   	if (cnp->cn_nameiop == DELETE ||
 ! 	    (wantparent && cnp->cn_nameiop != CREATE &&
 ! 	     cnp->cn_nameiop != LOOKUP))
   		docache = 0;
   	rdonly = cnp->cn_flags & RDONLY;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702021450.GAA20595>