Fix an overflow in the GPT code, I wasn't allocating enough slice structures.
commitae81fc47598ab8866857a80cf85c0b8c929d7d9b
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)
treed694e601be7ae1dd21c2856a4bf2fb9b765817ef
parente937bfcecf540813a4957a16d95eb86ab4dc5724
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