aboutsummaryrefslogtreecommitdiffstats
path: root/block/partitions
diff options
context:
space:
mode:
authorPhilippe De Muyter <phdm@macqel.be>2013-02-27 20:05:16 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-27 22:10:21 -0500
commit86ee8ba64daf5e09a71e4c216f81fae8d1c937f3 (patch)
tree074962cd77e6d2cfaef867a1eeadb2c83fdd8ebc /block/partitions
parent3c94ce6f48f484bbc4dba83c0ed1f98f5e10957c (diff)
block/partition/msdos: detect AIX formatted disks even without 55aa
AIX formatted disks do not always have the MSDOS 55aa signature. This happens e.g. for unbootable AIX disks. Up to now, such disks were not recognized as AIX disks, because of the missing 55aa. Fix that by inverting the two tests. Let's first check for the AIX magic strings, and only if that fails check for the MSDOS magic word. Signed-off-by: Philippe De Muyter <phdm@macqel.be> Cc: Andreas Mohr <andi@lisas.de> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Jens Axboe <axboe@kernel.dk> Cc: Olaf Hering <olh@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block/partitions')
-rw-r--r--block/partitions/msdos.c11
1 files changed, 8 insertions, 3 deletions
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,14 +455,19 @@ int msdos_partition(struct parsed_partitions *state)
455 data = read_part_sector(state, 0, &sect); 455 data = read_part_sector(state, 0, &sect);
456 if (!data) 456 if (!data)
457 return -1; 457 return -1;
458 if (!msdos_magic_present(data + 510)) { 458
459 /*
460 * Note order! (some AIX disks, e.g. unbootable kind,
461 * have no MSDOS 55aa)
462 */
463 if (aix_magic_present(state, data)) {
459 put_dev_sector(sect); 464 put_dev_sector(sect);
465 strlcat(state->pp_buf, " [AIX]", PAGE_SIZE);
460 return 0; 466 return 0;
461 } 467 }
462 468
463 if (aix_magic_present(state, data)) { 469 if (!msdos_magic_present(data + 510)) {
464 put_dev_sector(sect); 470 put_dev_sector(sect);
465 strlcat(state->pp_buf, " [AIX]", PAGE_SIZE);
466 return 0; 471 return 0;
467 } 472 }
468 473