Subject: Panics in #define DIAGNOSTIC code ?
To: None <tech-kern@netbsd.org>
From: Heiko W.Rupp <hwr@pilhuhn.de>
List: tech-kern
Date: 05/01/1999 13:24:05
Hi,
looking at kern/7321, I saw that the panic mentioned
is produced as result of
#ifdef DIAGNOSTIC
if (ISSET(bp->b_flags, B_DONE|B_DELWRI) &&
bp->b_bcount < size)
panic("getblk: block size invariant failed");
#endif
(kern/vfs_bio.c)
While it is a good idea, to have some invariant checking now and then,
I don't see the point to panic the system here.
Either
- the checked invariant is not important, so a printf() is enough
or
- the check is important as it could lead to inconsistent data
otherwise, then it shoudl always be executed and not only when
DIAGNOSTIC is defined.
What do others think?
--
See <a href="http://www.netbsd.org">NetBSD</a> for a multiplatform OS
What would you term a successful computer date?
"Hands-on experience."