summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid
diff options
context:
space:
mode:
authorKarel Zak2009-12-15 02:17:28 +0100
committerKarel Zak2009-12-15 02:17:28 +0100
commit8b9e7578a7ec0f8ae8757255ffed39ccfbb3c98f (patch)
tree844ee340b09ad1fe7859212b5c4a3d908376317b /shlibs/blkid
parentdocs: add LGPLv2+ to list of licenses (diff)
downloadkernel-qcow2-util-linux-8b9e7578a7ec0f8ae8757255ffed39ccfbb3c98f.tar.gz
kernel-qcow2-util-linux-8b9e7578a7ec0f8ae8757255ffed39ccfbb3c98f.tar.xz
kernel-qcow2-util-linux-8b9e7578a7ec0f8ae8757255ffed39ccfbb3c98f.zip
libblkid: fix Adaptec RAID detection
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid')
-rw-r--r--shlibs/blkid/src/superblocks/adaptec_raid.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/shlibs/blkid/src/superblocks/adaptec_raid.c b/shlibs/blkid/src/superblocks/adaptec_raid.c
index d7a42a67a..c6b175b44 100644
--- a/shlibs/blkid/src/superblocks/adaptec_raid.c
+++ b/shlibs/blkid/src/superblocks/adaptec_raid.c
@@ -16,6 +16,7 @@
#include "superblocks.h"
struct adaptec_metadata {
+
uint32_t b0idcode;
uint8_t lunsave[8];
uint16_t sdtype;
@@ -63,13 +64,13 @@ struct adaptec_metadata {
uint32_t fwTestMagic;
uint32_t fwTestSeqNum;
uint8_t fwTestRes[8];
- uint8_t smagic[4];
+ uint32_t smagic;
uint32_t raidtbl;
uint16_t raidline;
uint8_t res9[0xF6];
} __attribute__((packed));
-#define AD_SIGNATURE "DPTM"
+#define AD_SIGNATURE 0x4450544D /* "DPTM" */
#define AD_MAGIC 0x37FC4D1E
static int probe_adraid(blkid_probe pr, const struct blkid_idmag *mag)
@@ -87,7 +88,7 @@ static int probe_adraid(blkid_probe pr, const struct blkid_idmag *mag)
sizeof(struct adaptec_metadata));
if (!ad)
return -1;
- if (memcmp(ad->smagic, AD_SIGNATURE, sizeof(AD_SIGNATURE)) != 0)
+ if (ad->smagic != be32_to_cpu(AD_SIGNATURE))
return -1;
if (ad->b0idcode != be32_to_cpu(AD_MAGIC))
return -1;