[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1359126343-3525-1-git-send-email-phdm@macqel.be>
Date: Fri, 25 Jan 2013 16:05:43 +0100
From: Philippe De Muyter <phdm@...qel.be>
To: linux-kernel@...r.kernel.org
Cc: axboe@...nel.dk, akpm@...ux-foundation.org, olh@...e.de,
Philippe De Muyter <phdm@...qel.be>
Subject: [PATCH] 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@...qel.be>
---
block/partitions/msdos.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/block/partitions/msdos.c b/block/partitions/msdos.c
index 8752a5d..4b31ed7 100644
--- a/block/partitions/msdos.c
+++ b/block/partitions/msdos.c
@@ -455,14 +455,15 @@ int msdos_partition(struct parsed_partitions *state)
data = read_part_sector(state, 0, §);
if (!data)
return -1;
- if (!msdos_magic_present(data + 510)) {
+
+ if (aix_magic_present(state, data)) {
put_dev_sector(sect);
+ strlcat(state->pp_buf, " [AIX]", PAGE_SIZE);
return 0;
}
- if (aix_magic_present(state, data)) {
+ if (!msdos_magic_present(data + 510)) {
put_dev_sector(sect);
- strlcat(state->pp_buf, " [AIX]", PAGE_SIZE);
return 0;
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists