summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-04-20 10:19:27 +0000
committerkib <kib@FreeBSD.org>2010-04-20 10:19:27 +0000
commitd5b92466a9368c3ebeeb351f627452e66b5ec709 (patch)
tree7e49d1727e5b7479c5623dea52d412a43e45ab60 /sys/kern
parent0be03f320b674f387da392d9e4fece5b67a79ae1 (diff)
downloadFreeBSD-src-d5b92466a9368c3ebeeb351f627452e66b5ec709.zip
FreeBSD-src-d5b92466a9368c3ebeeb351f627452e66b5ec709.tar.gz
The cache_enter(9) function shall not be called for doomed dvp.
Assert this. In the reported panic, vdestroy() fired the assertion "vp has namecache for ..", because pseudofs may end up doing cache_enter() with reclaimed dvp, after dotdot lookup temporary unlocked dvp. Similar problem exists in ufs_lookup() for "." lookup, when vnode lock needs to be upgraded. Verify that dvp is not reclaimed before calling cache_enter(). Reported and tested by: pho Reviewed by: kan MFC after: 2 weeks
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 533ec97..a13a721 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -611,6 +611,8 @@ cache_enter(dvp, vp, cnp)
CTR3(KTR_VFS, "cache_enter(%p, %p, %s)", dvp, vp, cnp->cn_nameptr);
VNASSERT(vp == NULL || (vp->v_iflag & VI_DOOMED) == 0, vp,
("cache_enter: Adding a doomed vnode"));
+ VNASSERT(dvp == NULL || (dvp->v_iflag & VI_DOOMED) == 0, dvp,
+ ("cache_enter: Doomed vnode used as src"));
if (!doingcache)
return;
OpenPOWER on IntegriCloud