Fix an overflow in the GPT code, I wasn't allocating enough slice structures.
commitfb04008fd309d69f9183dc98f43437c13d4bc78d
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 17 Jun 2007 09:56:19 +0000 (17 09:56 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 17 Jun 2007 09:56:19 +0000 (17 09:56 +0000)
treef84be73e4eab73c919d85dc43b1cf0b979c6ede0
parentb9167ccc5cff854bda8217a557655188f40670db
Fix an overflow in the GPT code, I wasn't allocating enough slice structures.
Fix the openmask array declaration, it was declaring too-large an array.

Disallow GPT partitions with invalid spans.

When calculating a virgin disklabel take into account the possibility of
absurdly small GPT or MBR slices that would cause the calculation of
disklabel->d_ncylinders to result in 0.  Reduce the number of heads and
the number of sectors per track until a reasonable cylinder count is
achieved.
sys/kern/subr_diskgpt.c
sys/kern/subr_diskslice.c
sys/sys/diskslice.h