cvs commit: src/sys/kern kern_shutdown.c

Scott Long scottl at freebsd.org
Wed Jul 21 09:56:43 PDT 2004


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


More information about the cvs-all mailing list