fix for kern/322, pointed out by osymh@gemini.oscs.montana.edu. Neither

suggested fix was correct: the suggested change to cache_lookup would cause
the counters to be incremented when doingcache was zero, and the suggested
change to cache_enter was prone to a race condition (e.g. if doingcache
became 1 between the cache_lookup and cache_enter).
This commit is contained in:
cgd 1994-07-05 19:09:32 +00:00
parent 923bab6d40
commit c5bedb0aa6
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_cache.c,v 1.7 1994/07/02 20:26:19 chopps Exp $ */
/* $NetBSD: vfs_cache.c,v 1.8 1994/07/05 19:09:32 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@ -95,8 +95,10 @@ cache_lookup(dvp, vpp, cnp)
{
register struct namecache *ncp, *ncq, **ncpp;
if (!doingcache)
if (!doingcache) {
cnp->cn_flags &= ~MAKEENTRY;
return (0);
}
if (cnp->cn_namelen > NCHNAMLEN) {
nchstats.ncs_long++;
cnp->cn_flags &= ~MAKEENTRY;