Do not expose unlocked unconstructed nullfs vnode on mount list.

Lock the native nullfs vnode lock before switching the locks.

Tested by:	pho
MFC after:	1 week
This commit is contained in:
kib 2012-03-02 09:48:46 +00:00
parent 93f2183184
commit cca832bf9d

View File

@ -172,12 +172,12 @@ static void
null_destroy_proto(struct vnode *vp, void *xp)
{
lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL);
VI_LOCK(vp);
vp->v_data = NULL;
vp->v_vnlock = &vp->v_lock;
vp->v_op = &dead_vnodeops;
VI_UNLOCK(vp);
(void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
vgone(vp);
vput(vp);
free(xp, M_NULLFSNODE);