Subject: CVS commit: syssrc
To: None <source-changes@netbsd.org>
From: Bill Sommerfeld <sommerfeld@netbsd.org>
List: source-changes
Date: 06/10/2000 11:44:45
Module Name:	syssrc
Committed By:	sommerfeld
Date:		Sat Jun 10 18:44:45 UTC 2000

Modified Files:
	syssrc/sys/kern: kern_lock.c kern_synch.c subr_pool.c subr_prf.c
	    vfs_subr.c
	syssrc/sys/sys: mount.h systm.h

Log Message:
Fix assorted bugs around shutdown/reboot/panic time.
 - add a new global variable, doing_shutdown, which is nonzero if
vfs_shutdown() or panic() have been called.
- in panic, set RB_NOSYNC if doing_shutdown is already set on entry
so we don't reenter vfs_shutdown if we panic'ed there.
 - in vfs_shutdown, don't use proc0's process for sys_sync unless
curproc is NULL.
 - in lockmgr, attribute successful locks to proc0 if doing_shutdown
&& curproc==NULL, and  panic if we can't get the lock right away; avoids the
spurious lockmgr DIAGNOSTIC panic from the ddb reboot command.
 - in subr_pool, deal with curproc==NULL in the doing_shutdown case.
 - in mfs_strategy, bitbucket writes if doing_shutdown, so we don't
wedge waiting for the mfs process.
 - in ltsleep, treat ((curproc == NULL) && doing_shutdown) like the
panicstr case.

Appears to fix: kern/9239, kern/10187, kern/9367.
May also fix kern/10122.


To generate a diff of this commit:
cvs rdiff -r1.31 -r1.32 syssrc/sys/kern/kern_lock.c
cvs rdiff -r1.77 -r1.78 syssrc/sys/kern/kern_synch.c
cvs rdiff -r1.36 -r1.37 syssrc/sys/kern/subr_pool.c
cvs rdiff -r1.73 -r1.74 syssrc/sys/kern/subr_prf.c
cvs rdiff -r1.127 -r1.128 syssrc/sys/kern/vfs_subr.c
cvs rdiff -r1.84 -r1.85 syssrc/sys/sys/mount.h
cvs rdiff -r1.110 -r1.111 syssrc/sys/sys/systm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.