A patch for Promise RAID1 broken

Heinz Mauelshagen mauelshagen at redhat.com
Wed Jan 12 14:40:29 UTC 2005


Thanks,

as mentioned in another mail: working on naming fixes.

Regards,
Heinz

On Thu, Dec 23, 2004 at 10:53:02PM +0800, tan.ming at netstd.com wrote:
> I have a Promise FastTrak100 raid card, and I have configured a RAID 1 
> driver without spare disk, and installed a Fedora Core 3 in another hard 
> disk. When I use the dmraid, it report find two raid 1 drivers, but both 
> are broken, the following is the error message:
> 
> dmraid -s -vv
> ERROR: pdc: device /dev/hde broken in RAID set "pdc_acdgjjgge" [1/2]
> ERROR: keeping degraded mirror set "pdc_acdgjjgge"
> ERROR: pdc: device /dev/hdg broken in RAID set "pdc_bdbachbhfh" [1/2]
> ERROR: keeping degraded mirror set "pdc_bdbachbhfh"
> *** Set
> name   : pdc_acdgjjgge
> size   : 78150656
> stride : 128
> type   : mirror
> status : broken
> subsets: 0
> devs   : 1
> spares : 0
> *** Set
> name   : pdc_bdbachbhfh
> size   : 78150656
> stride : 128
> type   : mirror
> status : broken
> subsets: 0
> devs   : 1
> spares : 0 
> 
> 
> I checked the code, and found that the name of raid driver is named by the 
> magic number of the raid disk, but the RAID1 contain two disks, have 
> different magic numbers, and the dmraid use the name to find the disks in 
> the same raid set, so the dmraid found two raid set, but both broken.
> 
> I modify the way of name the raid set, use all the disk magic number, and 
> tested successfully in my computer.
> 
> The following is the patch:
> 
> --- lib/format/ataraid/pdc.c.orig       2004-12-23 21:19:47.000000000 
> +0800
> +++ lib/format/ataraid/pdc.c    2004-12-23 21:56:42.334972696 +0800
> @@ -24,7 +24,14 @@ static const char *handler = HANDLER;
>  /* FIXME: better name ? */
>  static size_t _name(struct pdc *pdc, char *str, size_t len)
>  {
> -       return snprintf(str, len, "pdc_%u", pdc->magic_1) + 1;
> +       int i, ret;
> +
> +       ret = snprintf(str, len, "pdc");
> +       for (i = 0; i < pdc->raid.total_disks; i++) {
> +               ret += snprintf(str + ret, len == 0 ? 0 : len - ret, 
> "_%8x", 
> +                               pdc->raid.disk[i].magic_0);
> +       }
> +       return ret + 1;
>  }
>  
>  static char *name(struct lib_context *lc, struct pdc *pdc, int type)
> 
> 
> 
>   Merry Christmas.

> _______________________________________________
> Ataraid-list mailing list
> Ataraid-list at redhat.com
> https://www.redhat.com/mailman/listinfo/ataraid-list

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Red Hat GmbH
Consulting Development Engineer                   Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
Mauelshagen at RedHat.com                            +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




More information about the Ataraid-list mailing list