linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Proposed enhancements to MD
@ 2004-01-13  0:34 Scott Long
  2004-01-13 16:26 ` Jakob Oestergaard
                   ` (4 more replies)
  0 siblings, 5 replies; 47+ messages in thread
From: Scott Long @ 2004-01-13  0:34 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2507 bytes --]

All,

Adaptec has been looking at the MD driver for a foundation for their
Open-Source software RAID stack.  This will help us provide full
and open support for current and future Adaptec RAID products (as
opposed to the limited support through closed drivers that we have now).

While MD is fairly functional and clean, there are a number of 
enhancements to it that we have been working on for a while and would
like to push out to the community for review and integration.  These
include:

- partition support for md devices:  MD does not support the concept of
   fdisk partitions; the only way to approximate this right now is by
   creating multiple arrays on the same media.  Fixing this is required
   for not only feature-completeness, but to allow our BIOS to recognise
   the partitions on an array and properly boot them as it would boot a
   normal disk.

- generic device arrival notification mechanism:  This is needed to
   support device hot-plug, and allow arrays to be automatically
   configured regardless of when the md module is loaded or initialized.
   RedHat EL3 has a scaled down version of this already, but it is
   specific to MD and only works if MD is statically compiled into the
   kernel.  A general mechanism will benefit MD as well as any other
   storage system that wants hot-arrival notices.

- RAID-0 fixes:  The MD RAID-0 personality is unable to perform I/O
   that spans a chunk boundary.  Modifications are needed so that it can
   take a request and break it up into 1 or more per-disk requests.

- Metadata abstraction:  We intend to support multiple on-disk metadata
   formats, along with the 'native MD' format.  To do this, specific
   knowledge of MD on-disk structures must be abstracted out of the core
   and personalities modules.

- DDF Metadata support: Future products will use the 'DDF' on-disk
   metadata scheme.  These products will be bootable by the BIOS, but
   must have DDF support in the OS.  This will plug into the abstraction
   mentioned above.

I'm going to push these changes out in phases in order to keep the risk
and churn to a minimum.  The attached patch is for the partition
support.  It was originally from Ingo Molnar, but has changed quite a
bit due to the radical changes in the disk/block layer in 2.6.  The 2.4
version works quite well, while the 2.6 version is fairly fresh.  One
problem that I have with it is that the created partitions show up in
/proc/partitions after running fdisk, but not after a reboot.

Scott

[-- Attachment #2: md_partition.diff --]
[-- Type: text/plain, Size: 1907 bytes --]

--- linux-2.6.1/drivers/md/md.c	2004-01-08 23:59:19.000000000 -0700
+++ md/linux-2.6.1/drivers/md/md.c	2004-01-12 14:46:33.818544376 -0700
@@ -1446,6 +1446,9 @@
 	return 1;
 }
 
+/* MD Partition definitions */
+#define MDP_MINOR_COUNT		16
+#define MDP_MINOR_SHIFT		4
 
 static struct kobject *md_probe(dev_t dev, int *part, void *data)
 {
@@ -1453,6 +1456,7 @@
 	int unit = *part;
 	mddev_t *mddev = mddev_find(unit);
 	struct gendisk *disk;
+	int index;
 
 	if (!mddev)
 		return NULL;
@@ -1463,15 +1467,22 @@
 		mddev_put(mddev);
 		return NULL;
 	}
-	disk = alloc_disk(1);
+	disk = alloc_disk(MDP_MINOR_COUNT);
 	if (!disk) {
 		up(&disks_sem);
 		mddev_put(mddev);
 		return NULL;
 	}
+	index = mdidx(mddev);
 	disk->major = MD_MAJOR;
-	disk->first_minor = mdidx(mddev);
-	sprintf(disk->disk_name, "md%d", mdidx(mddev));
+	disk->first_minor = index << MDP_MINOR_SHIFT;
+	disk->minors = MDP_MINOR_COUNT;
+	if (index >= 26) {
+		sprintf(disk->disk_name, "md%c%c",
+			'a' + index/26-1,'a' + index % 26);
+	} else {
+		sprintf(disk->disk_name, "md%c", 'a' + index % 26);
+	}
 	disk->fops = &md_fops;
 	disk->private_data = mddev;
 	disk->queue = mddev->queue;
@@ -2512,18 +2523,21 @@
 	 * 4 sectors (with a BIG number of cylinders...). This drives
 	 * dosfs just mad... ;-)
 	 */
+#define MD_HEADS	254
+#define MD_SECTORS	60
 		case HDIO_GETGEO:
 			if (!loc) {
 				err = -EINVAL;
 				goto abort_unlock;
 			}
-			err = put_user (2, (char *) &loc->heads);
+			err = put_user (MD_HEADS, (char *) &loc->heads);
 			if (err)
 				goto abort_unlock;
-			err = put_user (4, (char *) &loc->sectors);
+			err = put_user (MD_SECTORS, (char *) &loc->sectors);
 			if (err)
 				goto abort_unlock;
-			err = put_user(get_capacity(disks[mdidx(mddev)])/8,
+			err = put_user(get_capacity(disks[mdidx(mddev)]) /
+						(MD_HEADS * MD_SECTORS),
 						(short *) &loc->cylinders);
 			if (err)
 				goto abort_unlock;

^ permalink raw reply	[flat|nested] 47+ messages in thread
[parent not found: <40036902.8080403@adaptec.com>]
* RE: Proposed enhancements to MD
@ 2004-01-13 19:59 Cress, Andrew R
  0 siblings, 0 replies; 47+ messages in thread
From: Cress, Andrew R @ 2004-01-13 19:59 UTC (permalink / raw)
  To: Jeff Garzik, mutex; +Cc: linux-kernel

That discussion was mostly in Nov & Dev 2002.
The Subject line was "RFC - new raid superblock layout for md driver".

Andy

-----Original Message-----
From: linux-kernel-owner@vger.kernel.org
[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Jeff Garzik
Sent: Tuesday, January 13, 2004 2:43 PM
To: mutex
Cc: Scott Long; linux-kernel@vger.kernel.org
Subject: Re: Proposed enhancements to MD


mutex wrote:
> On Tue, Jan 13, 2004 at 02:05:55PM -0500 or thereabouts, Jeff Garzik
wrote:
> 
>>>How about a endian safe superblock ?  Seriously, is that a 'bug' or a
>>>'feature' ?  Or do people just not care.
>>
>>
>>There was a thread discussing md's new superblock design, did you 
>>research/follow that?  neilb was actively soliciting comments and
there 
>>was an amount of discussion.
>>
> 
> 
> hmm I don't remember that... was it on lkml or the raid development
> list ? Can you give me a string/date to search around ?


Other than "neil brown md superblock" don't recall.  In the past year or

two :)  There were patches, so it wasn't just discussion.

	Jeff



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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

end of thread, other threads:[~2004-01-16 14:14 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-13  0:34 Proposed enhancements to MD Scott Long
2004-01-13 16:26 ` Jakob Oestergaard
     [not found]   ` <20040113201058.GD1594@srv-lnx2600.matchmail.com>
2004-01-14 19:07     ` Jakob Oestergaard
     [not found]       ` <20040114194052.GK1594@srv-lnx2600.matchmail.com>
2004-01-14 21:02         ` Jakob Oestergaard
     [not found]           ` <20040114222447.GL1594@srv-lnx2600.matchmail.com>
2004-01-15  1:42             ` Jakob Oestergaard
2004-01-13 18:21 ` mutex
2004-01-13 19:05   ` Jeff Garzik
2004-01-13 19:30     ` mutex
2004-01-13 19:43       ` Jeff Garzik
2004-01-13 20:00         ` mutex
2004-01-13 20:44   ` Scott Long
2004-01-13 18:44 ` Jeff Garzik
2004-01-13 19:01   ` John Bradford
2004-01-13 19:41   ` Matt Domsch
2004-01-13 22:10     ` Arjan van de Ven
2004-01-16  9:31     ` Lars Marowsky-Bree
2004-01-16  9:57       ` Arjan van de Ven
2004-01-13 20:41   ` Scott Long
2004-01-13 22:33     ` Jure Pečar
2004-01-13 22:44       ` Scott Long
2004-01-13 22:56       ` viro
2004-01-14 15:52     ` Kevin Corry
2004-01-13 22:42   ` Luca Berra
2004-01-13 22:06 ` Arjan van de Ven
2004-01-13 22:44   ` Wakko Warner
2004-01-13 22:34     ` Arjan van de Ven
2004-01-13 23:09     ` Andreas Steinmetz
2004-01-13 23:38       ` Wakko Warner
2004-01-14 16:16         ` Kevin Corry
2004-01-14 16:53           ` Kevin P. Fleming
2004-01-14 23:07 ` Neil Brown
2004-01-15 21:52   ` Matt Domsch
2004-01-16  9:24     ` Lars Marowsky-Bree
2004-01-16 13:43       ` Matt Domsch
2004-01-16 13:56         ` Lars Marowsky-Bree
2004-01-16 14:06           ` Christoph Hellwig
2004-01-16 14:11             ` Matt Domsch
2004-01-16 14:13               ` Christoph Hellwig
     [not found] <40036902.8080403@adaptec.com>
2004-01-13 14:19 ` Proposed Enhancements " Matt Domsch
2004-01-13 17:13   ` Andreas Dilger
2004-01-13 22:26     ` Andreas Dilger
2004-01-13 18:19   ` Kevin P. Fleming
2004-01-13 18:19   ` Jeff Garzik
2004-01-13 20:29     ` Chris Friesen
2004-01-13 20:35       ` Matt Domsch
2004-01-13 21:10     ` Matt Domsch
2004-01-13 19:59 Proposed enhancements " Cress, Andrew R

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).