summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-04-15 00:49:35 +0000
committerdg <dg@FreeBSD.org>1995-04-15 00:49:35 +0000
commit9dad5219aa9266ebf915c046ed308f83e5e9abe0 (patch)
treee8958fa46783dc57d1b6954135dfb3063cb788f4 /sys/kern/vfs_cache.c
parent16a72c3c13c7b20c52f9e49a8b783355681824c8 (diff)
downloadFreeBSD-src-9dad5219aa9266ebf915c046ed308f83e5e9abe0.zip
FreeBSD-src-9dad5219aa9266ebf915c046ed308f83e5e9abe0.tar.gz
Fixed serious off by one bug I introduced that will likely cause the
machine to panic whenever the name cache fills up. Submitted by: John Dyson
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index bb4b8be..e8f1b16 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_cache.c 8.3 (Berkeley) 8/22/94
- * $Id: vfs_cache.c,v 1.12 1995/03/19 09:33:51 davidg Exp $
+ * $Id: vfs_cache.c,v 1.13 1995/04/04 02:01:13 davidg Exp $
*/
#include <sys/param.h>
@@ -271,7 +271,7 @@ cache_purge(vp)
vp->v_id = ++nextvnodeid;
if (nextvnodeid != 0)
return;
- for (ncpp = &nchashtbl[nchash]; ncpp >= nchashtbl; ncpp--) {
+ for (ncpp = &nchashtbl[nchash - 1]; ncpp >= nchashtbl; ncpp--) {
while(ncpp->lh_first)
PURGE(ncpp->lh_first);
}
@@ -296,7 +296,7 @@ cache_purgevfs(mp)
struct namecache *ncp, *nxtcp;
/* Scan hash tables for applicable entries */
- for (ncpp = &nchashtbl[nchash]; ncpp >= nchashtbl; ncpp--) {
+ for (ncpp = &nchashtbl[nchash - 1]; ncpp >= nchashtbl; ncpp--) {
ncp = ncpp->lh_first;
while(ncp) {
if (ncp->nc_dvpid != ncp->nc_dvp->v_id ||
OpenPOWER on IntegriCloud