Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Aug 2004 14:30:22 -0400
From:      Brian Fundakowski Feldman <green@FreeBSD.org>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.org>
Cc:        Roman Kurakin <rik@cronyx.ru>
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
Message-ID:  <20040826183022.GO77326@green.homeunix.org>
In-Reply-To: <20040826133752.GP30151@darkness.comp.waw.pl>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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.                       \,,,,,,,,,,,,,,,,,,,,,,\



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