freebsd-nq/sys
Bruce Evans 6bfb820292 Quick fix for stack overflow when there are more than about 25 slices.
Using recursion to traverse the recursive data structure for extended
partitions was never good, but when slice support was implemented in
1995, the recursion worked for the default maximum number of slices
(32), and standard fdisk utilities didn't support creating more than
the default number.  Even then, corrupt extended partitions could
cause endless recursion, because we attempt to check all slices, even
ones which we don't turn into devices.

The recursion has succumbed to creeping features.  The stack requirements
for each level had grown to 204 bytes on i386's.  Most of the growth was
caused by adding a 64-byte copy of the DOSpartition table to each frame.
The kernel stack size has shrunk to about 5K on i386's.  Most of the
shrinkage was caused by the growth of `struct sigacts' by 2388 bytes
to support 128 signals.

Linux fdisk (a 1997 version at least) can now create 60 slices (4 standard
ones, 56 for logical drives within extended partitions, and it seems to
be leaving room to map the 4 BSD partitions on my test drive), and Linux
(2.2.29 and 2.3.35 at least) now reports all these slices at boot time.

The fix limits the recursion to 16 levels (4 + 16 slices) and recovers
32 bytes per level caused by gcc pessimizing for space.  Switching to
a static buffer doesn't cause any problems due to recursion, since the
buffer is not passed down.  Using a static buffer is wrong in general
because it requires the giant lock to protect it.  However, this problem
is small compared with using a static buffer for dsname().  We sometimes
neglect to copy the result of dsname() before sleeping.

Also fixed slice names when we find more than MAX_SLICES (32) slices.
The number of the last slice found was not passed passed recursively.
The limit on the recursion now prevents finding more than 32 slices
with a standard extended partition data structure anyway.
2000-01-27 05:11:29 +00:00
..
alpha Remove a no-op "port ?" declaration. 2000-01-24 08:51:16 +00:00
amd64 Add soft updates to the set of things being tagged. Syntax cleanup. 2000-01-27 01:22:06 +00:00
boot Add driver support for the Aironet 4500/4800 series wireless 802.11 2000-01-14 20:41:03 +00:00
cam Because we added 4 bytes to the inquiry data size, we need to 2000-01-25 21:24:52 +00:00
coda Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
compat Fix handling of svr4_sigsets, which are implemented in SysVR4 as a sequence 2000-01-15 15:38:17 +00:00
compile
conf Get the ppc driver from sys/isa instead of sys/i386/isa. 2000-01-25 22:25:52 +00:00
contrib During fastpath processing for removal of a short-lived inode, the 2000-01-18 01:33:05 +00:00
crypto Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
ddb Add a new mechanism, cndbctl(), to tell the console driver that 2000-01-11 14:54:01 +00:00
dev handle simplex devices right 2000-01-26 20:27:45 +00:00
fs Fix bde'isms in acl/extattr syscall interface, renaming syscalls to 2000-01-19 06:07:34 +00:00
geom Cleanup some remaining bdev fluff. 2000-01-16 09:25:10 +00:00
gnu Give vn_isdisk() a second argument where it can return a suitable errno. 2000-01-10 12:04:27 +00:00
i4b update to isdn4bsd beta release 0.90 1999-12-14 20:54:38 +00:00
i386 Add soft updates to the set of things being tagged. Syntax cleanup. 2000-01-27 01:22:06 +00:00
isa * Don't use ivars to access resources, bus_set/get_resource is much better. 2000-01-25 22:21:45 +00:00
isofs/cd9660 remove check now done in vn_isdisk(). 2000-01-10 12:24:36 +00:00
kern Quick fix for stack overflow when there are more than about 25 slices. 2000-01-27 05:11:29 +00:00
libkern Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 05:07:58 +00:00
miscfs Fix bde'isms in acl/extattr syscall interface, renaming syscalls to 2000-01-19 06:07:34 +00:00
modules Re-add vpo. I've just re-tested this in a 'make world' on a December 2000-01-26 15:15:50 +00:00
msdosfs Give vn_isdisk() a second argument where it can return a suitable errno. 2000-01-10 12:04:27 +00:00
net Move the *intrq variables into net/intrq.c and unconditionally 2000-01-24 20:39:02 +00:00
netatalk Move the *intrq variables into net/intrq.c and unconditionally 2000-01-24 20:39:02 +00:00
netatm Move the *intrq variables into net/intrq.c and unconditionally 2000-01-24 20:39:02 +00:00
netgraph Add control message ASCII conversion for this node type. 2000-01-27 01:32:53 +00:00
netinet Avoid m_len and m_pkthdr.len inconsistency when changing m_len 2000-01-25 01:26:47 +00:00
netinet6 Move the *intrq variables into net/intrq.c and unconditionally 2000-01-24 20:39:02 +00:00
netipx Move the *intrq variables into net/intrq.c and unconditionally 2000-01-24 20:39:02 +00:00
netkey comment the string after #endif 2000-01-15 05:15:06 +00:00
netnatm Move the *intrq variables into net/intrq.c and unconditionally 2000-01-24 20:39:02 +00:00
netncp Forward declare some structs so that this header is more self-suifficent. 2000-01-14 19:54:42 +00:00
netns Move the *intrq variables into net/intrq.c and unconditionally 2000-01-24 20:39:02 +00:00
nfs Fix catastrophic bug in NQNFS related to UDP mounts. The 'nqhost' 2000-01-26 20:51:29 +00:00
nfsclient The alpha build cuases the 'nfsuid bloated' warning to occur. Well, 2000-01-13 20:18:25 +00:00
nfsserver The alpha build cuases the 'nfsuid bloated' warning to occur. Well, 2000-01-13 20:18:25 +00:00
ntfs Forward declare some structs so that this header is more self-suifficent. 2000-01-14 19:54:42 +00:00
nwfs Check if module was compiled without SMP support and running on 2000-01-15 08:35:48 +00:00
pc98 Synced with sys/i386/isa/isa_compat.h and pcaudio.c revisions 1.26 and 2000-01-26 11:23:51 +00:00
pccard Propagate MAC address in CIS tupple to dev/ed/ driver. 2000-01-21 03:08:46 +00:00
pci Properly teardown the allocated and initialised stuff when an error 2000-01-26 10:52:27 +00:00
posix4 Track libc_r addition of semaphores implementation. 2000-01-20 07:55:42 +00:00
powerpc The kernel side of per-process unaligned access control (printing, fixing & 2000-01-16 07:07:33 +00:00
rpc $Id$ -> $FreeBSD$ 1999-08-27 23:45:13 +00:00
svr4 Fix handling of svr4_sigsets, which are implemented in SysVR4 as a sequence 2000-01-15 15:38:17 +00:00
sys A few more touchups: 2000-01-26 16:15:48 +00:00
tools Use a seperate -c and -h mode. The vnode_if.c file is compiled only into 1999-12-12 16:43:05 +00:00
ufs During fastpath processing for removal of a short-lived inode, the 2000-01-18 01:33:05 +00:00
vm The swapdev_vp changes made to rip out the swap specfs interaction 2000-01-25 17:49:12 +00:00
Makefile ${MACHINE} -> ${MACHINE_ARCH} 1999-11-14 13:54:44 +00:00