diff --git a/block/partitions/msdos.c b/block/partitions/msdos.c index 8752a5d26565..7681cd295ab8 100644 --- a/block/partitions/msdos.c +++ b/block/partitions/msdos.c @@ -455,17 +455,22 @@ int msdos_partition(struct parsed_partitions *state) data = read_part_sector(state, 0, §); if (!data) return -1; - if (!msdos_magic_present(data + 510)) { - put_dev_sector(sect); - return 0; - } + /* + * Note order! (some AIX disks, e.g. unbootable kind, + * have no MSDOS 55aa) + */ if (aix_magic_present(state, data)) { put_dev_sector(sect); strlcat(state->pp_buf, " [AIX]", PAGE_SIZE); return 0; } + if (!msdos_magic_present(data + 510)) { + put_dev_sector(sect); + return 0; + } + /* * Now that the 55aa signature is present, this is probably * either the boot sector of a FAT filesystem or a DOS-type