diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index da6a61b84bd7..45577abfa50f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -785,9 +785,6 @@ vdestroy(struct vnode *vp) VNASSERT(TAILQ_EMPTY(&vp->v_cache_dst), vp, ("vp has namecache dst")); VNASSERT(LIST_EMPTY(&vp->v_cache_src), vp, ("vp has namecache src")); VI_UNLOCK(vp); -#ifdef MAC - mac_destroy_vnode(vp); -#endif if (vp->v_pollinfo != NULL) { knlist_destroy(&vp->v_pollinfo->vpi_selinfo.si_note); mtx_destroy(&vp->v_pollinfo->vpi_lock); @@ -799,6 +796,9 @@ vdestroy(struct vnode *vp) #endif lockdestroy(vp->v_vnlock); mtx_destroy(&vp->v_interlock); +#ifdef MAC + mac_destroy_vnode(vp); +#endif uma_zfree(vnode_zone, vp); }