From b84d879639f83d35d3fcd909222522c928bf974b Mon Sep 17 00:00:00 2001 From: Mark Fortescue Date: Wed, 25 Jul 2007 18:30:08 -0700 Subject: [PARTITION] MSDOS: Fix Sun num_partitions handling. Correct the Solaris x86 number of partitions (slices) is a way that is backward compatible with the earlier size. This works without a new VTOC structure definition as the timestamp and v_asciilabel fields in the VTOC are not used by the kernel yet. Signed-off-by: Mark Fortescue Signed-off-by: David S. Miller --- fs/partitions/msdos.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs/partitions') diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index 4ccec4cd136..5567ec0d03a 100644 --- a/fs/partitions/msdos.c +++ b/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; -- cgit v1.2.3