diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2005-06-17 01:05:13 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2005-06-17 01:05:13 +0000 |
commit | 32b6dcd8a4c816ca8c4b51b50acffc6c957028eb (patch) | |
tree | 72784ea2a3ca62c1cc6546096eca973cfdf0aa82 | |
parent | 482b893365c9ae156ad3a3b9404d746f9e2acf3d (diff) |
Notes
-rw-r--r-- | sys/kern/vfs_cache.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 88ecc3569fa1..4dfbe93669e1 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -493,8 +493,18 @@ cache_enter(dvp, vp, cnp) if (cnp->cn_namelen == 1) { return; } + /* + * For dotdot lookups only cache the v_dd pointer if the + * directory has a link back to its parent via v_cache_dst. + * Without this an unlinked directory would keep a soft + * reference to its parent which could not be NULLd at + * cache_purge() time. + */ if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { - dvp->v_dd = vp; + CACHE_LOCK(); + if (!TAILQ_EMPTY(&dvp->v_cache_dst)) + dvp->v_dd = vp; + CACHE_UNLOCK(); return; } } |