From bf13a22df54cad9ad59cabecedbf565d0bfcdbf0 Mon Sep 17 00:00:00 2001 From: Mark Fortescue Date: Wed, 25 Jul 2007 18:30:08 -0700 Subject: [PATCH] --- yaml --- r: 63159 b: refs/heads/master c: b84d879639f83d35d3fcd909222522c928bf974b h: refs/heads/master i: 63157: 1febff642aaca3381642c0b52cfc75c3d7940269 63155: 1258c222afd1cee1d33dddaf9b32c7c5a53c04b6 63151: 2aa368861e79c19d7cdc62025426f0945469a763 v: v3 --- [refs] | 2 +- trunk/fs/partitions/msdos.c | 5 ++++- trunk/include/linux/genhd.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 685e41a62065..9e8b808edea6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cce933bc831c451f48ca26e5b0d9bfdfbfb327f8 +refs/heads/master: b84d879639f83d35d3fcd909222522c928bf974b diff --git a/trunk/fs/partitions/msdos.c b/trunk/fs/partitions/msdos.c index 4ccec4cd1367..5567ec0d03a3 100644 --- a/trunk/fs/partitions/msdos.c +++ b/trunk/fs/partitions/msdos.c @@ -203,6 +203,7 @@ parse_solaris_x86(struct parsed_partitions *state, struct block_device *bdev, Sector sect; struct solaris_x86_vtoc *v; int i; + short max_nparts; v = (struct solaris_x86_vtoc *)read_dev_sector(bdev, offset+1, §); if (!v) @@ -218,7 +219,9 @@ parse_solaris_x86(struct parsed_partitions *state, struct block_device *bdev, put_dev_sector(sect); return; } - for (i=0; inextlimit; i++) { + /* Ensure we can handle previous case of VTOC with 8 entries gracefully */ + max_nparts = le16_to_cpu (v->v_nparts) > 8 ? SOLARIS_X86_NUMSLICE : 8; + for (i=0; inextlimit; i++) { struct solaris_x86_slice *s = &v->v_slice[i]; if (s->s_size == 0) continue; diff --git a/trunk/include/linux/genhd.h b/trunk/include/linux/genhd.h index 9756fc102a83..a47b8025d399 100644 --- a/trunk/include/linux/genhd.h +++ b/trunk/include/linux/genhd.h @@ -264,7 +264,7 @@ static inline void set_capacity(struct gendisk *disk, sector_t size) #ifdef CONFIG_SOLARIS_X86_PARTITION -#define SOLARIS_X86_NUMSLICE 8 +#define SOLARIS_X86_NUMSLICE 16 #define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL) struct solaris_x86_slice {