PERFORCE change 20080 for review
Robert Watson
rwatson at freebsd.org
Thu Oct 24 20:50:38 GMT 2002
http://perforce.freebsd.org/chv.cgi?CH=20080
Change 20080 by rwatson at rwatson_tislabs on 2002/10/24 13:50:12
Avoid warning more than once per boot about the EA transaction
issue if there's a file system that doesn't support EA
transactions and yet has been frobbed by MAC as multilabel
on extended attributes.
While I'm here, document lack of locking on mac_late and
ea_warn_once, and suggest why that's OK.
Affected files ...
.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#328 edit
Differences ...
==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#328 (text+ko) ====
@@ -110,8 +110,19 @@
SYSCTL_UINT(_security_mac, OID_AUTO, max_policies, CTLFLAG_RD,
&mac_max_policies, 0, "");
+/*
+ * Has the kernel started generating labeled objects yet? All read/write
+ * access to this variable is serialized during the boot process. Following
+ * the end of serialization, we don't update this flag; no locking.
+ */
static int mac_late = 0;
+/*
+ * Warn about EA transactions only the first time they happen.
+ * Weak coherency, no locking.
+ */
+static int ea_warn_once = 0;
+
static int mac_enforce_fs = 1;
SYSCTL_INT(_security_mac, OID_AUTO, enforce_fs, CTLFLAG_RW,
&mac_enforce_fs, 0, "Enforce MAC policy on file system objects");
@@ -1803,7 +1814,11 @@
error = VOP_OPENEXTATTR(vp, cred, curthread);
if (error == EOPNOTSUPP) {
/* XXX: Optionally abort if transactions not supported. */
- printf("Warning: transactions not supported in EA write.\n");
+ if (ea_warn_once == 0) {
+ printf("Warning: transactions not supported "
+ "in EA write.\n");
+ ea_warn_once = 1;
+ }
} else if (error)
return (error);
@@ -1834,7 +1849,11 @@
error = VOP_OPENEXTATTR(vp, cred, curthread);
if (error == EOPNOTSUPP) {
/* XXX: Optionally abort if transactions not supported. */
- printf("Warning: transactions not supported in EA write.\n");
+ if (ea_warn_once == 0) {
+ printf("Warning: transactions not supported "
+ "in EA write.\n");
+ ea_warn_once = 1;
+ }
} else if (error)
return (error);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list