cvs commit: src/sys/geom/concat g_concat.c src/sys/geom/label g_label.c src/sys/geom/mirror g_mirror.c src/sys/geom/raid3 g_raid3.c src/sys/geom/stripe g_stripe.c

Brian Fundakowski Feldman green at FreeBSD.org
Thu Aug 26 13:07:40 PDT 2004


On Thu, Aug 26, 2004 at 09:11:15PM +0200, Poul-Henning Kamp wrote:
> In message <20040826183022.GO77326 at green.homeunix.org>, Brian Fundakowski Feldm
> an writes:
> >> KASSERT(error == 0 && pp->sectorsize > 0 && pp->mediasize > 0, ("Buggy code."));
> >
> >I don't like that one bit.
> 
> Get used to it :-)
> 
> >KASSERT() should be reserved for serious
> >programming errors -- guarding against side cases that show major
> >error.
> 
> That KASSERT does guide against a major error on the part of the
> programmer.
> 
> In GEOM I have generously sprinkled KASSERTs for the very purpose
> of stopping programmer misunderstandings or attempts to be smart.
> The intent is that the programmer will find his bugs even during
> light testing and that the KASSERTs will help clarify the intentional
> use of APIs.
> 
> They have been very successful in this respect, and more will be
> added as I think them up.

Why in the world would you crash the machine when you don't have to?
I use KASSERT()s quite liberally, too, you know, but running into
crashes in half-finished kernel code that's in the tree -- as a user
-- is far inferior to running into errors and warnings that do not
halt the whole system.

-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green at FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\


More information about the cvs-src mailing list