Date: Tue, 16 Sep 1997 08:18:25 +0200 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Eivind Eklund <perhaps@yes.no> Cc: hackers@FreeBSD.ORG Subject: Re: Pre-conditions (was Re: cvs commit: src/sys/nfs nfs_vnops.c) Message-ID: <271.874390705@critter.freebsd.dk> In-Reply-To: Your message of "Tue, 16 Sep 1997 01:32:28 %2B0200." <199709152332.BAA25440@bitbox.follo.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <199709152332.BAA25440@bitbox.follo.net>, Eivind Eklund writes: > >> Modified files: >> sys/nfs nfs_vnops.c >> Log: >> Don't repeat checks done at general level. > >On a fairly general level: I'd have changed these to consistency >checks enclosed in #if DEBUG/#endif, and a panic (lacking a good >standardized assert facility; assert() is message-less and thus not >good enough). I like to make 'each routine its own castle' in >debugging mode, not trusting ANYTHING that is passed in from anywhere. > >How is this for other people? Is that considered unnecessary >cluttering of the sources? Done correctly, I find it a very good form >of documentation of each functions pre-conditions (and possibly >post-conditions/invariants, but that is much more clutter). If circumstances warrant it, ie: you suspect a problem in that area, by all means go ahead. If there is no sign of trouble, don't clutter the sources. In this particular case we're talkink about checks done against the vnodes, ie the generic layer, they belong in the generic layer, not in the individual filesystems. -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?271.874390705>