From cca832bf9d799f80670b8c806b557b652a8b49b6 Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 2 Mar 2012 09:48:46 +0000 Subject: [PATCH] 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 --- sys/fs/nullfs/null_subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index ae29bfccba7a..7e3571dcb47d 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -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);