Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jun 2013 09:15:37 GMT
From:      Jonathan Anderson <jonathan@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 229620 for review
Message-ID:  <201306120915.r5C9FbwL055415@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@229620?ac=10

Change 229620 by jonathan@jonathan-on-zenith on 2013/06/12 09:14:51

	Promote some kernel libtesla errors to full panics.
	
	This is a local change that shouldn't be replicated to upstream.

Affected files ...

.. //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_class.c#2 edit
.. //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_key.c#2 edit
.. //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_notification.c#4 edit
.. //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_store.c#2 edit

Differences ...

==== //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_class.c#2 (text+ko) ====

@@ -138,7 +138,12 @@
 
 	// A new instance must not look inactive.
 	if ((state == 0) && (name->tk_mask == 0))
+#ifdef _KERNEL
+		tesla_panic("inactive-looking new instance: state %d, mask 0x%x",
+			state, name->tk_mask);
+#else
 		return (TESLA_ERROR_EINVAL);
+#endif
 
 	if (tclass->tc_free == 0)
 		return (TESLA_ERROR_ENOMEM);

==== //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_key.c#2 (text+ko) ====

@@ -72,6 +72,12 @@
 		if (IS_SET(source->tk_mask, i)) {
 			if (IS_SET(dest->tk_mask, i)) {
 			    if (dest->tk_keys[i] != source->tk_keys[i])
+#ifdef _KERNEL
+				tesla_panic("dest key %d (0x%x) != source (0x%x)",
+					i, dest->tk_keys[i], source->tk_keys[i]);
+#else
+		return (TESLA_ERROR_EINVAL);
+#endif
 				return (TESLA_ERROR_EINVAL);
 			} else {
 				dest->tk_keys[i] = source->tk_keys[i];

==== //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_notification.c#4 (text+ko) ====

@@ -42,7 +42,11 @@
 	    || !tehp->teh_clone || !tehp->teh_fail_no_instance
 	    || !tehp->teh_bad_transition
 	    || !tehp->teh_accept || !tehp->teh_ignored)
+#ifdef _KERNEL
+		tesla_panic("invalid error handler vector");
+#else
 		return (TESLA_ERROR_EINVAL);
+#endif
 
 	ev_handlers = tehp;
 	return (TESLA_SUCCESS);

==== //depot/projects/ctsrd/tesla/src/sys/contrib/tesla/libtesla/tesla_store.c#2 (text+ko) ====

@@ -96,7 +96,11 @@
 	}
 
 	default:
+#ifdef _KERNEL
+		tesla_panic("invalid TESLA_SCOPE %d", context);
+#else
 		return (TESLA_ERROR_EINVAL);
+#endif
 	}
 
 	if (store->length == 0) {
@@ -159,7 +163,11 @@
 	assert(tclassp != NULL);
 
 	if (id >= store->length)
+#ifdef _KERNEL
+		tesla_panic("requested class id %d > store length (%d)", id, store->length);
+#else
 		return (TESLA_ERROR_EINVAL);
+#endif
 
 	tesla_class *tclass = &store->classes[id];
 	assert(tclass != NULL);



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