linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix for "Booting from raid1 -- md: invalid raid superblock mag"
@ 2005-11-27 21:22 Raphaël Rigo
  2005-11-28  2:15 ` David M. Strang
  0 siblings, 1 reply; 2+ messages in thread
From: Raphaël Rigo @ 2005-11-27 21:22 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dstrang

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@twilight-hall.net>

--- 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix for "Booting from raid1 -- md: invalid raid superblock mag"
  2005-11-27 21:22 [PATCH] Fix for "Booting from raid1 -- md: invalid raid superblock mag" Raphaël Rigo
@ 2005-11-28  2:15 ` David M. Strang
  0 siblings, 0 replies; 2+ messages in thread
From: David M. Strang @ 2005-11-28  2:15 UTC (permalink / raw)
  To: Raphaël Rigo; +Cc: linux-raid

On Sunday 27 November 2005 16:18:23, Raphaël Rigo wrote
>
> 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.
>

^^-- 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-28  2:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-27 21:22 [PATCH] Fix for "Booting from raid1 -- md: invalid raid superblock mag" Raphaël Rigo
2005-11-28  2:15 ` David M. Strang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).