1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00

- Don't hold the vn lock while calling VOP_CLOSE in vclean().

This commit is contained in:
Jeff Roberson 2002-07-07 06:38:22 +00:00
parent c7118ed61b
commit 18c48f437f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99515

View File

@ -1838,6 +1838,7 @@ vflush(mp, rootrefs, flags)
if ((error = VFS_ROOT(mp, &rootvp)) != 0)
return (error);
vput(rootvp);
}
mtx_lock(&mntvnode_mtx);
loop:
@ -2001,6 +2002,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
@ -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.
*/