Quoting Robert Watson <[EMAIL PROTECTED]> (Sat, 15 Jul 2006 10:23:28 +0100
(BST)):
>
> On Fri, 14 Jul 2006, Alfred Perlstein wrote:
>
> > Could the KASSERT here be changed to a warning log message instead?
> >
> > I don't like the idea of kernel modules failing catastrophically
> > when they could fail gracefully by just emitting an error.
> >
> > Is that OK?
> >
> > + KASSERT(kp.ki_stat <= sizeof(linux_state),
> > + ("linprocfs: don't know how to handle unknown FreeBSD state"));
>
> Or, if this is really just a structure size thing, we should pick it up at
> compile-time with CTASSERT?
ki_stat contains a value which corresponds to the states like idle,
diskwait, ... And linux_state is a static array (ki_stat is an index
into it). We don't have a "this value is an upper bound to the possible
state values"-value, so I can't use an CTASSERT.
This will only panic when someone adds another state to the existing
ones but doesn't extend the array.
Suggestions how to handle this in a way which satisfies everyone is
welcome (is a warning enough?).
Bye,
Alexander.
--
...and that is how we know the Earth to be banana-shaped.
http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"