lkml.org 
[lkml]   [2003]   [Dec]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 28 Dec 2003 09:11:54 -0800
FromWalt H <>
SubjectPATCH: Alternate pdcraid superblock finder
Hi,

This patch proposes an alternate method of finding the raid superblock on
Promise raid devices. It hasn't received much testing, so I left the old routine
intact and just check for ideinfo->head == 255 to use my method. I'm not aware
of any reasons why my method wouldn't work for all drives, but I thought this
was a safer change.

-Walt Holman

--- /usr/src/temp/linux-2.4.21-xfs/linux/drivers/ide/raid/pdcraid.c	2003-12-22 17:59:09.653139067 -0800
+++ linux/drivers/ide/raid/pdcraid.c	2003-07-21 20:47:14.000000000 -0700
@@ -361,7 +361,11 @@
 	if (ideinfo->sect==0)
 		return 0;
-	lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect));
-	lba = lba * (ideinfo->head*ideinfo->sect);
-	lba = lba - ideinfo->sect;
+	if (ideinfo->head!=255) {
+		lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect));
+		lba = lba * (ideinfo->head*ideinfo->sect);
+		lba = lba - ideinfo->sect; }
+	else {
+		lba = ideinfo->capacity - ideinfo->sect;
+	}
 
 	return lba;
\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008