aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/partitions/msdos.c5
-rw-r--r--include/linux/genhd.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index 4ccec4cd1367..5567ec0d03a3 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,
203 Sector sect; 203 Sector sect;
204 struct solaris_x86_vtoc *v; 204 struct solaris_x86_vtoc *v;
205 int i; 205 int i;
206 short max_nparts;
206 207
207 v = (struct solaris_x86_vtoc *)read_dev_sector(bdev, offset+1, &sect); 208 v = (struct solaris_x86_vtoc *)read_dev_sector(bdev, offset+1, &sect);
208 if (!v) 209 if (!v)
@@ -218,7 +219,9 @@ parse_solaris_x86(struct parsed_partitions *state, struct block_device *bdev,
218 put_dev_sector(sect); 219 put_dev_sector(sect);
219 return; 220 return;
220 } 221 }
221 for (i=0; i<SOLARIS_X86_NUMSLICE && state->next<state->limit; i++) { 222 /* Ensure we can handle previous case of VTOC with 8 entries gracefully */
223 max_nparts = le16_to_cpu (v->v_nparts) > 8 ? SOLARIS_X86_NUMSLICE : 8;
224 for (i=0; i<max_nparts && state->next<state->limit; i++) {
222 struct solaris_x86_slice *s = &v->v_slice[i]; 225 struct solaris_x86_slice *s = &v->v_slice[i];
223 if (s->s_size == 0) 226 if (s->s_size == 0)
224 continue; 227 continue;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 9756fc102a83..a47b8025d399 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -264,7 +264,7 @@ static inline void set_capacity(struct gendisk *disk, sector_t size)
264 264
265#ifdef CONFIG_SOLARIS_X86_PARTITION 265#ifdef CONFIG_SOLARIS_X86_PARTITION
266 266
267#define SOLARIS_X86_NUMSLICE 8 267#define SOLARIS_X86_NUMSLICE 16
268#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL) 268#define SOLARIS_X86_VTOC_SANE (0x600DDEEEUL)
269 269
270struct solaris_x86_slice { 270struct solaris_x86_slice {