summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2013-11-27 15:48:44 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2013-11-27 15:48:44 +0000
commitd5601f8319a8e88668fb1518f60c1f6a3ecd7435 (patch)
treec8988e53d41c16bdb76584162d33c713813a4eff /sys
parent0bdb12eb3be403f1f062e710532a4db2184f37d0 (diff)
Assert that we never have destinations cached for a non-VDIR vnode.
ok beck@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_cache.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 49ff3644fac..4c82103fd07 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_cache.c,v 1.35 2013/03/27 01:56:50 tedu Exp $ */
+/* $OpenBSD: vfs_cache.c,v 1.36 2013/11/27 15:48:43 jsing Exp $ */
/* $NetBSD: vfs_cache.c,v 1.13 1996/02/04 02:18:09 christos Exp $ */
/*
@@ -430,6 +430,9 @@ cache_purge(struct vnode *vp)
{
struct namecache *ncp;
+ /* We should never have destinations cached for a non-VDIR vnode. */
+ KASSERT(vp->v_type == VDIR || TAILQ_EMPTY(&vp->v_cache_dst));
+
while ((ncp = TAILQ_FIRST(&vp->v_cache_dst)))
cache_zap(ncp);
while ((ncp = RB_ROOT(&vp->v_nc_tree)))