summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-03-04 11:43:38 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-03-04 11:43:38 +0000
commitefd918d95e9023504230e54d914e864cc75f4d08 (patch)
tree1cd9d290cffd50c49e5b038584002684dae49953 /sys/kern
parent6b0ed6ba3c5ddabe5d7f7690fd4b4a84178bfd98 (diff)
Fix handling of names bigger than NCHNAMLEN in cache_enter(), okay tedu@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_cache.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 68c979d5a53..64201bfe1f1 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_cache.c,v 1.13 2004/12/26 21:22:13 miod Exp $ */
+/* $OpenBSD: vfs_cache.c,v 1.14 2005/03/04 11:43:37 pedro Exp $ */
/* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */
/*
@@ -257,12 +257,9 @@ cache_enter(dvp, vp, cnp)
register struct namecache *ncp;
register struct nchashhead *ncpp;
-#ifdef DIAGNOSTIC
- if (cnp->cn_namelen > NCHNAMLEN)
- panic("cache_enter: name too long");
-#endif
- if (!doingcache)
+ if (!doingcache || cnp->cn_namelen > NCHNAMLEN)
return;
+
/*
* Free the cache slot at head of lru chain.
*/