Patch to add RAID autostart to IBM partitions

From: Pete Zaitcev
Date: Sat Oct 16 2004 - 00:50:30 EST


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++;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/