[PATCH] Fix for "Booting from raid1 -- md: invalid raid superblock mag"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
here is a patch that fixes the problem described by David M. Stra.

The problem is that the array is first initialized with SET_ARRAY_INFO without
any specific parameter and the md driver uses the 0.90 behaviour by default.
So we must specify it's 1.0 superblock by doing another SET_ARRAY_INFO.

I'll correct if anything is wrong.

Regards,
Raphaël Rigo

Signed-off-by: Raphaël Rigo <raphael.rigo@xxxxxxxxxxxxxxxxx>

--- linux-2.6.14.2/init/do_mounts_md.c.orig     2005-11-27 22:12:40.000000000 +0100
+++ linux-2.6.14.2/init/do_mounts_md.c  2005-11-27 22:20:54.000000000 +0100
@@ -218,6 +218,19 @@ static void __init md_setup_drive(void)
                                err = sys_ioctl(fd, ADD_NEW_DISK, (long)&dinfo);
                        }
                } else {
+                       mdu_array_info_t ainfo;
+
+                       memset(&ainfo, 0, sizeof(ainfo));
+                       ainfo.major_version = 1;
+                       ainfo.minor_version = 0;
+
+                       err = sys_ioctl(fd, SET_ARRAY_INFO, (long)&ainfo);
+                       if(err) {
+                               printk(KERN_WARNING
+                               "md: Cannot set array info for md%d\n",
+                               minor);
+                       }
+
                        /* persistent */
                        for (i = 0; i <= MD_SB_DISKS; i++) {
                                dev = devices[i];
@@ -225,7 +238,7 @@ static void __init md_setup_drive(void)
                                        break;
                                dinfo.major = MAJOR(dev);
                                dinfo.minor = MINOR(dev);
-                               sys_ioctl(fd, ADD_NEW_DISK, (long)&dinfo);
+                               err = sys_ioctl(fd, ADD_NEW_DISK, (long)&dinfo);
                        }
                }
                if (!err)

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux