summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-04-01 20:16:02 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-04-01 20:16:02 +0000
commit8a61c85fb5ebd735393a77a5c3f5e9f8076290c9 (patch)
treed09444e932a43134a3ad8df3470c5fd000c28952
parent5f9845a476311780e56f718ec0d3f7d110ec96a9 (diff)
calling pfind() and checking that the process doesn't exist is not
enough to allow us to call vgone() from procfs_inactive(). to avoid a deadlock, check for VXLOCK as well, in case we were called from vclean(). problem report from Sho Fujita, okay tedu@.
-rw-r--r--sys/miscfs/procfs/procfs_vnops.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/miscfs/procfs/procfs_vnops.c b/sys/miscfs/procfs/procfs_vnops.c
index 1d608b03b97..03f8f295d5d 100644
--- a/sys/miscfs/procfs/procfs_vnops.c
+++ b/sys/miscfs/procfs/procfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_vnops.c,v 1.33 2004/10/19 12:42:28 pedro Exp $ */
+/* $OpenBSD: procfs_vnops.c,v 1.34 2005/04/01 20:16:01 pedro Exp $ */
/* $NetBSD: procfs_vnops.c,v 1.40 1996/03/16 23:52:55 christos Exp $ */
/*
@@ -354,10 +354,11 @@ procfs_inactive(v)
struct vop_inactive_args /* {
struct vnode *a_vp;
} */ *ap = v;
- struct pfsnode *pfs = VTOPFS(ap->a_vp);
+ struct vnode *vp = ap->a_vp;
+ struct pfsnode *pfs = VTOPFS(vp);
- if (pfind(pfs->pfs_pid) == 0)
- vgone(ap->a_vp);
+ if (pfind(pfs->pfs_pid) == NULL && !(vp->v_flag & VXLOCK))
+ vgone(vp);
return (0);
}