summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2006-02-23 05:15:37 +0000
committerjeff <jeff@FreeBSD.org>2006-02-23 05:15:37 +0000
commit63c47d3ba4ae5bc60372b5af574be6fb12f7eec0 (patch)
tree6a5874665e6270ccda910fa5728d6bfee4fd41c3 /sys
parent18512cf2d80fe44e56a75f0fb04562e969a38a6f (diff)
downloadFreeBSD-src-63c47d3ba4ae5bc60372b5af574be6fb12f7eec0.zip
FreeBSD-src-63c47d3ba4ae5bc60372b5af574be6fb12f7eec0.tar.gz
- Release the mount ref once the vnode has been recycled rather than once
the last reference is dropped. I forgot that vnodes can stick around for a very long time until processes discover that they are dead. This means that a vnode reference is not sufficient to keep the mount referenced and even more code will be required to ref mount points. Discovered by: kris
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_subr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7cd93a3..f850b67 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -790,8 +790,6 @@ vdestroy(struct vnode *vp)
mtx_destroy(&vp->v_pollinfo->vpi_lock);
uma_zfree(vnodepoll_zone, vp->v_pollinfo);
}
- if (vp->v_mount)
- vfs_rel(vp->v_mount);
#ifdef INVARIANTS
/* XXX Elsewhere we can detect an already freed vnode via NULL v_op. */
vp->v_op = NULL;
@@ -949,11 +947,12 @@ delmntque(struct vnode *vp)
if (mp == NULL)
return;
MNT_ILOCK(mp);
+ vp->v_mount = NULL;
VNASSERT(mp->mnt_nvnodelistsize > 0, vp,
("bad mount point vnode list size"));
TAILQ_REMOVE(&mp->mnt_nvnodelist, vp, v_nmntvnodes);
mp->mnt_nvnodelistsize--;
- /* mnt ref is released in vdestroy. */
+ MNT_REL(mp);
MNT_IUNLOCK(mp);
}
OpenPOWER on IntegriCloud