- Acquire the vnode interlock prior to dropping the mntvnode_mtx.

- Make a note of the lack of XLOCK protection in this code.  We would access
   a vnode while it is changing identities without Giant.
This commit is contained in:
Jeff Roberson 2003-10-04 13:44:51 +00:00
parent 0c31ea3b2d
commit bb33b5fabf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120736

View file

@ -943,8 +943,9 @@ nfs_sync(struct mount *mp, int waitfor, struct ucred *cred, struct thread *td)
if (vp->v_mount != mp)
goto loop;
vnp = TAILQ_NEXT(vp, v_nmntvnodes);
mtx_unlock(&mntvnode_mtx);
/* XXX Not obeying XLOCK. */
VI_LOCK(vp);
mtx_unlock(&mntvnode_mtx);
if (VOP_ISLOCKED(vp, NULL) || TAILQ_EMPTY(&vp->v_dirtyblkhd) ||
waitfor == MNT_LAZY) {
VI_UNLOCK(vp);