freebsd-dev/sys
Ian Dowse a90ef2ae0f The kernel did not hold a vnode reference associated with the
`rootvnode' pointer, but vfs_syscalls.c's checkdirs() assumed that
it did. This bug reliably caused a panic at reboot time if any
filesystem had been mounted directly over /.

The checkdirs() function is called at mount time to find any process
fd_cdir or fd_rdir pointers referencing the covered mountpoint
vnode. It transfers these to point at the root of the new filesystem.
However, this process was not reversed at unmount time, so processes
with a cwd/root at a mount point would unexpectedly lose their
cwd/root following a mount-unmount cycle at that mountpoint.

This change should fix both of the above issues. Start_init() now
holds an extra vnode reference corresponding to `rootvnode', and
dounmount() releases this reference when the root filesystem is
unmounted just before reboot. Dounmount() now undoes the actions
taken by checkdirs() at mount time; any process cdir/rdir pointers
that reference the root vnode of the unmounted filesystem are
transferred to the now-uncovered vnode.

Reviewed by:	bde, phk
2001-02-28 20:54:28 +00:00
..
alpha Rename switch_trampoline() to fork_trampoline() on the alpha and ia64. 2001-02-22 16:56:53 +00:00
amd64 Make the kernel actually compile and link under a.out, using 2001-02-25 07:44:39 +00:00
arm/include Correct disordering which is corresponding to bde's fix to 2001-02-17 14:51:11 +00:00
boot Eliminate mdocNG warnings caused by misplaced or extraneous macro calls. 2001-02-28 17:38:53 +00:00
cam o Support AUTO SENSE correctly. 2001-02-25 12:40:30 +00:00
coda Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
compat MFS: bring the consistent `compat_3_brand' support into -CURRENT 2001-02-24 22:20:11 +00:00
compile
conf Update NOTES wrt hint for fxp. 2001-02-27 23:02:00 +00:00
contrib/dev Patch the reintroduced (~0 << 32) == 1 bug with a cryptic but functional 2001-02-02 08:31:50 +00:00
crypto Initial import of AES algorithm code (aka Rijndael) from KAME. 2000-10-30 11:03:32 +00:00
ddb Use macro API for <sys/queue.h> 2000-12-30 22:06:19 +00:00
dev Slightly reimplement some recently added helper functions as methods, so 2001-02-27 23:13:20 +00:00
fs Display the Joliet Extension 'level' in the log message. 2001-02-23 03:43:05 +00:00
geom Fix a braino in ccd's clone routine. 2001-01-29 06:18:14 +00:00
gnu Remove the leading underscore from all symbols defined in x86 asm 2001-02-25 06:29:04 +00:00
i4b Preceed/preceeding are not english words. Use precede or preceding. 2001-02-18 10:25:42 +00:00
i386 Linux does not filesystem-sync file-backed writable mmap pages on 2001-02-28 04:30:27 +00:00
ia64 sched_swi -> swi_sched 2001-02-24 19:09:37 +00:00
isa Fixed style bugs in clock.c rev.1.164 and cpu.h rev.1.52-1.53 -- declare 2001-02-19 03:00:34 +00:00
isofs/cd9660 Display the Joliet Extension 'level' in the log message. 2001-02-23 03:43:05 +00:00
kern The kernel did not hold a vnode reference associated with the 2001-02-28 20:54:28 +00:00
libkern RIP <machine/lock.h>. 2001-02-11 10:44:09 +00:00
miscfs o Move per-process jail pointer (p->pr_prison) to inside of the subject 2001-02-21 06:39:57 +00:00
modules Not quite working makefile to make the nmdm device as a module. 2001-02-27 16:53:59 +00:00
msdosfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
net Protect against negative numbers as well 2001-02-26 09:52:43 +00:00
netatalk Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netatm Preceed/preceeding are not english words. Use precede and preceding. 2001-02-18 10:43:53 +00:00
netgraph Shuffle netgraph mutexes a bit and hold a reference on a node 2001-02-28 18:49:09 +00:00
netinet Fix jails. 2001-02-28 09:38:48 +00:00
netinet6 More IP option length validation. 2001-02-26 03:41:13 +00:00
netipx Another round of the <sys/queue.h> FOREACH transmogriffer. 2001-02-04 16:08:18 +00:00
netkey fixed possibility of panic at key_acquire(). 2001-01-14 17:25:08 +00:00
netnatm Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netncp Implement m_getm() which will perform an "all or nothing" mbuf + cluster 2001-02-14 05:13:04 +00:00
netns * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT. 2000-12-21 21:44:31 +00:00
nfs Fix lockup for loopback NFS mounts. The pipelined I/O limitations could be 2001-02-28 04:13:11 +00:00
nfsclient Fix lockup for loopback NFS mounts. The pipelined I/O limitations could be 2001-02-28 04:13:11 +00:00
nfsserver Switch to using a struct xucred instead of a struct xucred when not 2001-02-18 13:30:20 +00:00
ntfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
nwfs Change and clean the mutex lock interface. 2001-02-09 06:11:45 +00:00
pc98 Added another wd33c93 based SCSI card driver which replaces the bs driver. 2001-02-27 12:34:01 +00:00
pccard Move ti1031 to the 16-bit bridge section 2001-02-07 01:16:40 +00:00
pci A better mousetrap: use device hints, as in: 2001-02-27 22:57:32 +00:00
posix4 Lock need_resched with sched_lock. 2001-02-22 13:46:09 +00:00
powerpc Rename switch_trampoline() to fork_trampoline() on the alpha and ia64. 2001-02-22 16:56:53 +00:00
rpc
svr4 This patchset fixes a large number of file descriptor race conditions. 2000-11-18 21:01:04 +00:00
sys Make "md" and "mdctl" macroized parameters. 2001-02-25 13:12:57 +00:00
tools Simplify this a bit so that it doesn't have to generate silly redundant 2000-12-06 06:59:38 +00:00
ufs Add a NOTE_REVOKE flag for vnodes, which is triggered from within vclean(). 2001-02-23 20:06:01 +00:00
vm If we intend to make the page writable without requiring another fault, 2001-02-28 04:26:43 +00:00
Makefile I should know better than to touch this without testing a 'make release' 2000-08-24 18:53:09 +00:00