Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2005 11:25:43 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 84049 for review
Message-ID:  <200509211125.j8LBPhcL042050@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509211125.j8LBPhcL042050>