- Don't hold the vn lock while calling VOP_CLOSE in vclean().
This commit is contained in:
parent
c7118ed61b
commit
18c48f437f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99515
@ -1838,6 +1838,7 @@ vflush(mp, rootrefs, flags)
|
|||||||
if ((error = VFS_ROOT(mp, &rootvp)) != 0)
|
if ((error = VFS_ROOT(mp, &rootvp)) != 0)
|
||||||
return (error);
|
return (error);
|
||||||
vput(rootvp);
|
vput(rootvp);
|
||||||
|
|
||||||
}
|
}
|
||||||
mtx_lock(&mntvnode_mtx);
|
mtx_lock(&mntvnode_mtx);
|
||||||
loop:
|
loop:
|
||||||
@ -2001,6 +2002,12 @@ vclean(vp, flags, td)
|
|||||||
|
|
||||||
VOP_DESTROYVOBJECT(vp);
|
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
|
* If purging an active vnode, it must be closed and
|
||||||
* deactivated before being reclaimed. Note that the
|
* deactivated before being reclaimed. Note that the
|
||||||
@ -2009,14 +2016,11 @@ vclean(vp, flags, td)
|
|||||||
if (active) {
|
if (active) {
|
||||||
if (flags & DOCLOSE)
|
if (flags & DOCLOSE)
|
||||||
VOP_CLOSE(vp, FNONBLOCK, NOCRED, td);
|
VOP_CLOSE(vp, FNONBLOCK, NOCRED, td);
|
||||||
|
if (vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT, td) != 0)
|
||||||
|
panic("vclean: cannot relock.");
|
||||||
VOP_INACTIVE(vp, td);
|
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.
|
* Reclaim the vnode.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user