From owner-cvs-all@FreeBSD.ORG Thu Aug 26 18:31:49 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 058FD16A4CE; Thu, 26 Aug 2004 18:31:48 +0000 (GMT) Received: from green.homeunix.org (pcp04368961pcs.nrockv01.md.comcast.net [69.140.212.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C61043D67; Thu, 26 Aug 2004 18:31:48 +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 i7QIUN8l088944; Thu, 26 Aug 2004 14:30:23 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id i7QIUNud088943; Thu, 26 Aug 2004 14:30:23 -0400 (EDT) (envelope-from green) Date: Thu, 26 Aug 2004 14:30:22 -0400 From: Brian Fundakowski Feldman To: Pawel Jakub Dawidek Message-ID: <20040826183022.GO77326@green.homeunix.org> References: <200408261242.i7QCgl7m012027@repoman.freebsd.org> <58622.1093524972@critter.freebsd.dk> <20040826131030.GO30151@darkness.comp.waw.pl> <412DE5B1.9090101@cronyx.ru> <20040826133752.GP30151@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040826133752.GP30151@darkness.comp.waw.pl> User-Agent: Mutt/1.5.6i cc: cvs-src@FreeBSD.org cc: Poul-Henning Kamp cc: src-committers@FreeBSD.org 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-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 18:31:49 -0000 On Thu, Aug 26, 2004 at 03:37:52PM +0200, Pawel Jakub Dawidek wrote: > On Thu, Aug 26, 2004 at 05:29:21PM +0400, Roman Kurakin wrote: > +> >Yes, I know that it should be done this way, but I'm not going to fix > +> >atapi-cd.c, scsi_da.c and scsi_cd.c and who knows what else. > +> >Those classes set error to 0 even when provider has not sectorsize > +> >and mediasize defined. > +> > > +> > > +> Does your code print any warning message in that case? > +> That could force authors of 'buggy' code to fix it. > > No, this should be KASSERT() inside g_error_provider(): > > KASSERT(error == 0 && pp->sectorsize > 0 && pp->mediasize > 0, ("Buggy code.")); I don't like that one bit. KASSERT() should be reserved for serious programming errors -- guarding against side cases that show major error. panic() should be reserved for cases where error recovery is impossible and errors are detected under the normal course of error checking. printf() should be used when there are simple mistakes that do not cause system instability if you recover from them. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\