Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jul 2004 10:55:27 -0600
From:      Scott Long <scottl@freebsd.org>
To:        Nate Lawson <nate@root.org>
Cc:        Roman Kurakin <rik@cronyx.ru>
Subject:   Re: cvs commit: src/sys/kern kern_shutdown.c
Message-ID:  <40FE9FFF.6050702@freebsd.org>
In-Reply-To: <40FE9A94.5090805@root.org>
References:  <200407211604.i6LG4kFK052991@repoman.freebsd.org> <40FE95FD.6000101@cronyx.ru> <40FE9A94.5090805@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Nate Lawson wrote:

> Roman Kurakin wrote:
> 
>> Robert Watson wrote:
>>
>>>  FreeBSD src repository
>>>
>>>  Modified files:
>>>    sys/kern             kern_shutdown.c  Log:
>>>  Don't sync the file system on panic by default.  This seems to 
>>> basically
>>>  work very infrequently, and often results in a compound panic which
>>>  confuses debugging; locking/SMP have made the layering violation (and
>>>  risks) of this more obvious over time.
>>>  
>>>  Discussed with: green, bde, et al.
>>>  
>>>  Revision  Changes    Path
>>>  1.160     +1 -1      src/sys/kern/kern_shutdown.c
> 
>  >
> 
>> How to change behavior?
>>
>> rik
> 
> 
> While Robert's followup was very detailed, I think the answer Rik is 
> looking for is "sysctl kern.sync_on_panic".  :)
> 
> -Nate

It should be noted that syncing on panic is almost never a good idea.
The whole idea of panic() is to signal that the system has gotten into
an inconsistent and unrecoverable state.  Do you really want to trust it
to spam your drive with buffers that are in an unknown state via a set
of codepaths that are in an unknown state?  It's much better to just
step back and let fsck try to repair the damage.  I can't remember a
single time in the last 4 years when a panic actually successfuly synced
out all of the buffers and shutdown the filesystem, so it's not likely
that you'll avoid a fsck on reboot with this.

Scott



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