summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-07-07 06:38:22 +0000
committerjeff <jeff@FreeBSD.org>2002-07-07 06:38:22 +0000
commitcca3a0ef3d4f089d8381461b007fc544f7c4026a (patch)
tree5b910d4f9774bbb430ec1336c6fdccb3ea140b01 /sys
parent8c632c03ee796eebe55c2b8c6071847e4c02ab84 (diff)
downloadFreeBSD-src-cca3a0ef3d4f089d8381461b007fc544f7c4026a.zip
FreeBSD-src-cca3a0ef3d4f089d8381461b007fc544f7c4026a.tar.gz
- Don't hold the vn lock while calling VOP_CLOSE in vclean().
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_subr.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 059b50b..637fa3e 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1838,6 +1838,7 @@ vflush(mp, rootrefs, flags)
if ((error = VFS_ROOT(mp, &rootvp)) != 0)
return (error);
vput(rootvp);
+
}
mtx_lock(&mntvnode_mtx);
loop:
@@ -2002,6 +2003,12 @@ vclean(vp, flags, td)
VOP_DESTROYVOBJECT(vp);
/*
+ * Any other processes trying to obtain this lock must first
+ * wait for VXLOCK to clear, then call the new lock operation.
+ */
+ VOP_UNLOCK(vp, 0, td);
+
+ /*
* If purging an active vnode, it must be closed and
* deactivated before being reclaimed. Note that the
* VOP_INACTIVE will unlock the vnode.
@@ -2009,14 +2016,11 @@ vclean(vp, flags, td)
if (active) {
if (flags & DOCLOSE)
VOP_CLOSE(vp, FNONBLOCK, NOCRED, td);
+ if (vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT, td) != 0)
+ panic("vclean: cannot relock.");
VOP_INACTIVE(vp, td);
- } else {
- /*
- * Any other processes trying to obtain this lock must first
- * wait for VXLOCK to clear, then call the new lock operation.
- */
- VOP_UNLOCK(vp, 0, td);
}
+
/*
* Reclaim the vnode.
*/
OpenPOWER on IntegriCloud