a dmraid bug on Promise RAID (urgent! resend)

"Conke Hu" <[email protected]>
Newsgroups gmane.linux.ataraid
Message-ID <[email protected]>
Resend

________________________________

From: Conke Hu 
Sent: 2006年9月29日 20:38
To: '[email protected]'
Cc: '[email protected]'
Subject: a dmraid bug on Promise RAID

 

Hi,

       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?

 

Thanks!

Conke

_______________________________________________
Ataraid-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/ataraid-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.