From owner-p4-projects@FreeBSD.ORG Wed Sep 21 11:25:44 2005 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 1DBB816A421; Wed, 21 Sep 2005 11:25:44 +0000 (GMT) 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 D5F8016A41F for ; Wed, 21 Sep 2005 11:25:43 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A24B343D48 for ; Wed, 21 Sep 2005 11:25:43 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8LBPhO4042053 for ; Wed, 21 Sep 2005 11:25:43 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8LBPhcL042050 for perforce@freebsd.org; Wed, 21 Sep 2005 11:25:43 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 21 Sep 2005 11:25:43 GMT Message-Id: <200509211125.j8LBPhcL042050@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 84049 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, 21 Sep 2005 11:25:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=84049 Change 84049 by rwatson@rwatson_zoo on 2005/09/21 11:25:01 When committing audit records in audit_record_write(), conditionally acquire Giant rather than asserting that the caller holds it, as Giant is not needed for some file systems now. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#34 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/kern_audit.c#34 (text+ko) ==== @@ -355,11 +355,9 @@ struct au_record *bsm; struct vattr vattr; struct statfs *mnt_stat = &vp->v_mount->mnt_stat; + int vfslocked; - /* - * XXXAUDIT: In the world of MPSAFE VFS, this may not be necessary. - */ - mtx_assert(&Giant, MA_OWNED); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); /* * First, gather statistics on the audit log file and file system @@ -546,6 +544,8 @@ panic("Audit store overflow; record queue drained."); } + VFS_UNLOCK_GIANT(vfslocked); + return (ret); }