summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authortrociny <trociny@FreeBSD.org>2012-02-25 10:15:41 +0000
committertrociny <trociny@FreeBSD.org>2012-02-25 10:15:41 +0000
commit87f7f0cfe8d3d17bc154ca2c0dcd51bca1444006 (patch)
tree8d321a0d4dfa05d863db2db15721bdb62ad66f41 /sys/kern/vfs_subr.c
parent1227707e5566e30c536ae473402e3c3445c746c1 (diff)
downloadFreeBSD-src-87f7f0cfe8d3d17bc154ca2c0dcd51bca1444006.zip
FreeBSD-src-87f7f0cfe8d3d17bc154ca2c0dcd51bca1444006.tar.gz
When detaching an unix domain socket, uipc_detach() checks
unp->unp_vnode pointer to detect if there is a vnode associated with (binded to) this socket and does necessary cleanup if there is. The issue is that after forced unmount this check may be too late as the unp_vnode is reclaimed and the reference is stale. To fix this provide a helper function that is called on a socket vnode reclamation to do necessary cleanup. Pointed by: kib Reviewed by: kib MFC after: 2 weeks
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 28562e6..8d3c6aa 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -2657,6 +2657,8 @@ vgonel(struct vnode *vp)
vinactive(vp, td);
VI_UNLOCK(vp);
}
+ if (vp->v_type == VSOCK)
+ vfs_unp_reclaim(vp);
/*
* Reclaim the vnode.
*/
OpenPOWER on IntegriCloud