diff options
author | jeff <jeff@FreeBSD.org> | 2005-07-07 07:33:10 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2005-07-07 07:33:10 +0000 |
commit | 0d69457df8ccd88ca9066d313c9d76c6bd22f148 (patch) | |
tree | 9f1b086dbb4649d3dcd42f1c24245c275d62b617 /sys/fs/pseudofs/pseudofs_vncache.c | |
parent | 08e6ec1ce10bf151e6ad76371cc1e1233015b7b7 (diff) | |
download | FreeBSD-src-0d69457df8ccd88ca9066d313c9d76c6bd22f148.zip FreeBSD-src-0d69457df8ccd88ca9066d313c9d76c6bd22f148.tar.gz |
- Since we don't hold a usecount in pfs_exit we have to get a holdcnt
prior to calling vgone() to prevent any races.
Sponsored by: Isilon Systems, Inc.
Approved by: re (vfs blanket)
Diffstat (limited to 'sys/fs/pseudofs/pseudofs_vncache.c')
-rw-r--r-- | sys/fs/pseudofs/pseudofs_vncache.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c index ecf75dc..4ce29af 100644 --- a/sys/fs/pseudofs/pseudofs_vncache.c +++ b/sys/fs/pseudofs/pseudofs_vncache.c @@ -250,10 +250,12 @@ pfs_exit(void *arg, struct proc *p) while (pvd != NULL) { if (pvd->pvd_pid == p->p_pid) { vnp = pvd->pvd_vnode; + vhold(vnp); mtx_unlock(&pfs_vncache_mutex); VOP_LOCK(vnp, LK_EXCLUSIVE, curthread); vgone(vnp); VOP_UNLOCK(vnp, 0, curthread); + vdrop(vnp); mtx_lock(&pfs_vncache_mutex); pvd = pfs_vncache; } else { @@ -282,10 +284,12 @@ pfs_disable(struct pfs_node *pn) while (pvd != NULL) { if (pvd->pvd_pn == pn) { vnp = pvd->pvd_vnode; + vhold(vnp); mtx_unlock(&pfs_vncache_mutex); VOP_LOCK(vnp, LK_EXCLUSIVE, curthread); vgone(vnp); VOP_UNLOCK(vnp, 0, curthread); + vdrop(vnp); mtx_lock(&pfs_vncache_mutex); pvd = pfs_vncache; } else { |