summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-09-30 20:51:48 +0000
committerrwatson <rwatson@FreeBSD.org>2002-09-30 20:51:48 +0000
commit5d5060bddf1bf4c263e0d232b8a8c4f352c2f5f1 (patch)
tree86fa56cf582686262cfe53465fbbdce1313c86de /sys/kern/vfs_subr.c
parent731b954aba3aed28d46e7f8b48828c6845fe3ada (diff)
downloadFreeBSD-src-5d5060bddf1bf4c263e0d232b8a8c4f352c2f5f1.zip
FreeBSD-src-5d5060bddf1bf4c263e0d232b8a8c4f352c2f5f1.tar.gz
Move vnode MAC label initialization to after the release of the vnode
interlock in getnewvnode() to avoid possible sleeps while holding the mutex. Note that the warning from Witness is a slight false positive since we know there will be no contention on the interlock since we haven't made the vnode available for use yet, but the theory is not a bad one. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 56ca7be..144d3da 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -990,14 +990,14 @@ getnewvnode(tag, mp, vops, vpp)
vp->v_tag = tag;
vp->v_op = vops;
lockinit(&vp->v_lock, PVFS, "vnlock", VLKTIMEOUT, LK_NOPAUSE);
-#ifdef MAC
- mac_init_vnode(vp);
-#endif
*vpp = vp;
vp->v_usecount = 1;
vp->v_data = 0;
vp->v_cachedid = -1;
VI_UNLOCK(vp);
+#ifdef MAC
+ mac_init_vnode(vp);
+#endif
insmntque(vp, mp);
return (0);
OpenPOWER on IntegriCloud