mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: schwidefsky@de.ibm.com
Cc: viro@parcelfarce.linux.theplanet.co.uk, zaitcev@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Patch to add RAID autostart to IBM partitions
Date: Fri, 15 Oct 2004 22:48:22 -0700	[thread overview]
Message-ID: <20041015224822.7d980a9e@lembas.zaitcev.lan> (raw)

Hi, guys:

This is an implementation of essentially the same mechanism which exists
in msdos.c and sun.c. It is needed when initrd tries to mount a root
on a RAID. One might ask, why the heck initrd cannot do it without a
kernel help. The answer is in the contrived API of the MD driver: there
is no way to ask "assemble md0"; applications must list components.
Anyway, if msdos.c does it, surely ibm.c ought to do it as well.

Please apply.

-- Pete

P.S. Martin: this is for bug LTC10616.

diff -urp -X dontdiff linux-2.6.9-rc4-mm1/fs/partitions/ibm.c linux-2.6.9-rc4-mm1-autoraid/fs/partitions/ibm.c
--- linux-2.6.9-rc4-mm1/fs/partitions/ibm.c	2003-10-01 15:18:05.000000000 -0700
+++ linux-2.6.9-rc4-mm1-autoraid/fs/partitions/ibm.c	2004-10-15 22:38:12.712453680 -0700
@@ -129,6 +129,7 @@ ibm_partition(struct parsed_partitions *
 		while ((data = read_dev_sector(bdev, blk*(blocksize/512),
 					       &sect)) != NULL) {
 			format1_label_t f1;
+			char *ch;
 
 			memcpy(&f1, data, sizeof(format1_label_t));
 			put_dev_sector(sect);
@@ -154,6 +155,14 @@ ibm_partition(struct parsed_partitions *
 			put_partition(state, counter + 1, 
 					 offset * (blocksize >> 9),
 					 size * (blocksize >> 9));
+
+			/* Corrupting the label buffer now to save the stack. */
+			EBCASC(f1.DS1DSNAM, 44);
+			f1.DS1DSNAM[44] = 0;
+			ch = strstr(f1.DS1DSNAM, "PART");
+			if (ch != NULL && strncmp(ch + 9, "RAID  ", 6) == 0)
+				state->parts[counter + 1].flags = 1;
+
 			counter++;
 			blk++;
 		}

             reply	other threads:[~2004-10-16  5:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-16  5:48 Pete Zaitcev [this message]
2004-10-16 11:09 ` Christoph Hellwig
2004-10-16 15:29   ` Pete Zaitcev
2004-10-19  1:54     ` Neil Brown
2004-10-19 16:32       ` Pete Zaitcev
2004-10-29  2:16         ` Neil Brown

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=20041015224822.7d980a9e@lembas.zaitcev.lan \
    --to=zaitcev@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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

all inboxes | Powered by JetHome®