linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Raphaël Rigo" <raphael.rigo@twilight-hall.net>
To: neilb@cse.unsw.edu.au
Cc: linux-raid@vger.kernel.org, dstrang@shellpower.net
Subject: [PATCH] Fix for "Booting from raid1 -- md: invalid raid superblock mag"
Date: Sun, 27 Nov 2005 22:22:20 +0100	[thread overview]
Message-ID: <438A238C.6030403@twilight-hall.net> (raw)

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

             reply	other threads:[~2005-11-27 21:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-27 21:22 Raphaël Rigo [this message]
2005-11-28  2:15 ` [PATCH] Fix for "Booting from raid1 -- md: invalid raid superblock mag" David M. Strang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=438A238C.6030403@twilight-hall.net \
    --to=raphael.rigo@twilight-hall.net \
    --cc=dstrang@shellpower.net \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).