From owner-cvs-src@FreeBSD.ORG Thu Aug 26 20:07:40 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1931C16A4CE; Thu, 26 Aug 2004 20:07:40 +0000 (GMT) Received: from green.homeunix.org (pcp04368961pcs.nrockv01.md.comcast.net [69.140.212.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CB9543D45; Thu, 26 Aug 2004 20:07:39 +0000 (GMT) (envelope-from green@green.homeunix.org) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.13.1/8.13.1) with ESMTP id i7QK7Tdu089614; Thu, 26 Aug 2004 16:07:29 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id i7QK7Sxg089613; Thu, 26 Aug 2004 16:07:28 -0400 (EDT) (envelope-from green) Date: Thu, 26 Aug 2004 16:07:28 -0400 From: Brian Fundakowski Feldman To: Poul-Henning Kamp Message-ID: <20040826200728.GP77326@green.homeunix.org> References: <20040826183022.GO77326@green.homeunix.org> <64740.1093547475@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <64740.1093547475@critter.freebsd.dk> User-Agent: Mutt/1.5.6i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Pawel Jakub Dawidek cc: cvs-all@FreeBSD.org cc: Roman Kurakin Subject: Re: 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 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 20:07:40 -0000 On Thu, Aug 26, 2004 at 09:11:15PM +0200, Poul-Henning Kamp wrote: > In message <20040826183022.GO77326@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@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\