Fix for "Booting from raid1 -- md: invalid raid superblock mag"
PATCH 1/1 Fix for "Booting from raid1 -- md: invalid raid superblock mag"
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
init/do_mounts_md.c 2005-11-27 22:20:54.000000000 +0100 renamed from init/do_mounts_md.c.orig 2005-11-27 22:12:40.000000000 +0100 +14 -1
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sunday 27 November 2005 16:18:23, Raphaël Rigo wrote
Quoted 4 lines
Hi,
here is a patch that fixes the problem described by David M. Stra.
Quoted 8 lines
The problem is that the array is first initialized with
SET_ARRAY_INFOwithout
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 anotherSET_ARRAY_INFO.I'll correct if anything is wrong.
^^-- This workaround does work; it may limit those run multiple raid arrays with different types superblocks in each array that need to be loaded via do_mounts_md.c -- but if you are using all superblock v1.0; this does get the job done.
Many thanks for the time you spent debugging this with me today.
-- David
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html