From owner-p4-projects@FreeBSD.ORG Wed Oct 11 17:34:41 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B79DC16A4C2; Wed, 11 Oct 2006 17:34:41 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95A1616A4A7 for ; Wed, 11 Oct 2006 17:34:41 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64E1E43DE6 for ; Wed, 11 Oct 2006 17:26:38 +0000 (GMT) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9BHQVCa090666 for ; Wed, 11 Oct 2006 17:26:31 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9BHQViQ090663 for perforce@freebsd.org; Wed, 11 Oct 2006 17:26:31 GMT (envelope-from millert@freebsd.org) Date: Wed, 11 Oct 2006 17:26:31 GMT Message-Id: <200610111726.k9BHQViQ090663@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 107691 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2006 17:34:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=107691 Change 107691 by millert@millert_macbook on 2006/10/11 17:26:17 Move block of code so that labeling is only performed in the non error code path and while the vnode is protected by an IO reference (v_iocount). Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/vfs/vfs_subr.c#6 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/vfs/vfs_subr.c#6 (text+ko) ==== @@ -3400,19 +3400,6 @@ vnode_unlock(vp); return(ENOENT); } -#ifdef MAC - if (vnode_mount(vp) != NULL && - vfs_flags(vnode_mount(vp)) & MNT_MULTILABEL) { - int error; - - error = vnode_label1(vp); - if (error) { - if (!locked) - vnode_unlock(vp); - return (error); - } - } -#endif /* * will return VL_DEAD ones */ @@ -3452,6 +3439,20 @@ vnode_list_remove(vp); } vp->v_iocount++; +#ifdef MAC + if (vnode_mount(vp) != NULL && + vfs_flags(vnode_mount(vp)) & MNT_MULTILABEL) { + int error; + + error = vnode_label1(vp); + if (error) { + vp->v_iocount--; + if (!locked) + vnode_unlock(vp); + return (error); + } + } +#endif #ifdef JOE_DEBUG record_vp(vp, 1); #endif