diff options
-rw-r--r-- | fs/partitions/msdos.c | 12 | ||||
-rw-r--r-- | include/linux/genhd.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index 8c7af1777819..dafd3b6b2dc3 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c | |||
@@ -63,15 +63,25 @@ msdos_magic_present(unsigned char *p) | |||
63 | #define AIX_LABEL_MAGIC4 0xC1 | 63 | #define AIX_LABEL_MAGIC4 0xC1 |
64 | static int aix_magic_present(unsigned char *p, struct block_device *bdev) | 64 | static int aix_magic_present(unsigned char *p, struct block_device *bdev) |
65 | { | 65 | { |
66 | struct partition *pt = (struct partition *) (p + 0x1be); | ||
66 | Sector sect; | 67 | Sector sect; |
67 | unsigned char *d; | 68 | unsigned char *d; |
68 | int ret = 0; | 69 | int slot, ret = 0; |
69 | 70 | ||
70 | if (p[0] != AIX_LABEL_MAGIC1 && | 71 | if (p[0] != AIX_LABEL_MAGIC1 && |
71 | p[1] != AIX_LABEL_MAGIC2 && | 72 | p[1] != AIX_LABEL_MAGIC2 && |
72 | p[2] != AIX_LABEL_MAGIC3 && | 73 | p[2] != AIX_LABEL_MAGIC3 && |
73 | p[3] != AIX_LABEL_MAGIC4) | 74 | p[3] != AIX_LABEL_MAGIC4) |
74 | return 0; | 75 | return 0; |
76 | /* Assume the partition table is valid if Linux partitions exists */ | ||
77 | for (slot = 1; slot <= 4; slot++, pt++) { | ||
78 | if (pt->sys_ind == LINUX_SWAP_PARTITION || | ||
79 | pt->sys_ind == LINUX_RAID_PARTITION || | ||
80 | pt->sys_ind == LINUX_DATA_PARTITION || | ||
81 | pt->sys_ind == LINUX_LVM_PARTITION || | ||
82 | is_extended_partition(pt)) | ||
83 | return 0; | ||
84 | } | ||
75 | d = read_dev_sector(bdev, 7, §); | 85 | d = read_dev_sector(bdev, 7, §); |
76 | if (d) { | 86 | if (d) { |
77 | if (d[0] == '_' && d[1] == 'L' && d[2] == 'V' && d[3] == 'M') | 87 | if (d[0] == '_' && d[1] == 'L' && d[2] == 'V' && d[3] == 'M') |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 0a022b2f63fc..7a566fad3f72 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -21,6 +21,8 @@ enum { | |||
21 | WIN98_EXTENDED_PARTITION = 0x0f, | 21 | WIN98_EXTENDED_PARTITION = 0x0f, |
22 | 22 | ||
23 | LINUX_SWAP_PARTITION = 0x82, | 23 | LINUX_SWAP_PARTITION = 0x82, |
24 | LINUX_DATA_PARTITION = 0x83, | ||
25 | LINUX_LVM_PARTITION = 0x8e, | ||
24 | LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */ | 26 | LINUX_RAID_PARTITION = 0xfd, /* autodetect RAID partition */ |
25 | 27 | ||
26 | SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION, | 28 | SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION, |