From owner-freebsd-bugs Sun Feb 2 06:50:05 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id GAA20601 for bugs-outgoing; Sun, 2 Feb 1997 06:50:05 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id GAA20595; Sun, 2 Feb 1997 06:50:02 -0800 (PST) Date: Sun, 2 Feb 1997 06:50:02 -0800 (PST) Message-Id: <199702021450.GAA20595@freefall.freebsd.org> To: freebsd-bugs Cc: From: Bruce Evans Subject: Re: kern/2635: NFS cache and access permissions. Reply-To: Bruce Evans Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR kern/2635; it has been noted by GNATS. From: Bruce Evans 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;