a dmraid bug on Promise RAID (urgent! resend)

Conke Hu chu at ati.com
Tue Oct 17 03:13:06 UTC 2006



From: Conke Hu 
Sent: 2006年9月29日 20:38
To: 'Mauelshagen at RedHat.com'
Cc: 'g.hoogewerf at gmail.com'
Subject: a dmraid bug on Promise RAID



       There is bug in pdc.c (lib/format/ataraid/pdc.c). when you activate the promise software RAID, you will get the following error messages:

#dmraid -ay

ERROR: pdc: identifying /dev/sda, magic_0, 0xb18d6/0xb16a4, magic_1: 0xb18d6/0xb18d6, total_disks: 2

ERROR: pdc: identifying /dev/sdb, magic_0, 0xb18d6/0xb16a5, magic_1: 0xb18d6/0xb18d6, total_disks: 2

No RAID disks  

       We’ve found the root cause. Firstly let’s take a look at struct pdc:

       struct pdc {

       uint8_t promise_id[PDC_ID_LENGTH];   /* 0x00 - 0x17 */

       uint32_t unknown_0;                /* 0x18 - 0x1B */

       uint32_t magic_0;                     /* 0x1C - 0x1F */

       According to the Promise engineer, the value set at offset 0x1C is not a magic number, but records the RAID engine version. So when dmraid executes the following code (lib/format/ataraid/pdc.c):

    if (pdc->magic_0 == pdc->raid.magic_0 &&

            pdc->raid.total_disks &&

            pdc->raid.total_disks < PDC_MAXDISKS)

                return 1;

       it always returns 1 since pdc->magic_0 never equals pdc->raid.magic_0 ! 

       To fix this bug, dmraid source code only needs to ignore checking magic_0, modified to the following:

       if ( pdc->raid.total_disks &&

            pdc->raid.total_disks < PDC_MAXDISKS)

                return 1;

       I have tested this modification and it is safe to delete “pdc->magic_0 == pdc->raid.magic_0”.

       Could you please do this change in next dmraid version?





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/ataraid-list/attachments/20061017/a171c9c3/attachment.htm>

More information about the Ataraid-list mailing list