panic() design question

Jeffrey Mulligan jbm at eos.UUCP
Sat Aug 25 04:13:52 AEST 1990


dave at tis.com (David I. Dalva) writes:

>The code goes something like this:

>	panic(s)
>		char *s;
>	{
>		printf("%s\n", s);
>		if (firsttime) {
>			firsttime = FALSE;
>			sync();
>		}
>		halt();
>	}

>I am experiencing a problem where the sync() itself is panicking
>(recursively) messing up the filesystem further.  Taking the sync()
>out greatly reduces filesystem damage.

It would seem that the use of the flag "firsttime" is to prevent
multiple or recursive calls to sunc(); if this is happening, then
perhaps whatever is causing the panic is also scribbling over
firsttime.  Maybe you could try moving it to another part of the
address space and see what happens.

My naive guess about doing a sync()/update()  at all, is that it's
just a probabalistic tradeoff, there is a certain probability that
there will be errors without a sync, there is another probability
that the sync will make matters worse.  It sounds like in your
case the roulette wheel is coming up 00.


-- 

	Jeff Mulligan (jbm at eos.arc.nasa.gov)
	NASA/Ames Research Ctr., Mail Stop 262-2, Moffet Field CA, 94035
	(415) 604-3745



More information about the Comp.unix.wizards mailing list