[patch] raidstart problem - weakness or bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I'v decided to build a raid set for on one of my machines here 
and while setting I did a simulated fail test so I knew what to expect
out of the fail/recovery process.

In the course of this I discover that raidstart (I used debian stable
to start with but reproduced and patched on raidtools 1.00-3) 
won't start and array where the  first drive listed in /etc/raidtab
has failed - or more accurately whose superblock is not readable.

An afternoons read through the code has led me to suggest this
patch as a fix. No doubt the more experienced raid hands will tell
me this is wrong for some subtle reason i can't see. ;_)

So what have I got wrong ?

TTFN
-- 
Roger. 	                        Home| http://www.sandman.uklinux.net/
Master of Peng Shui.      (Ancient oriental art of Penguin Arranging)
Work|Independent Systems Consultant | http://www.firstdatabase.co.uk/
So what are the eigenvalues and eigenvectors of 'The Matrix'? --anon
diff -urN raidtools-1.00.3/raidlib.c raidtools-1.00.3-rgg/raidlib.c
--- raidtools-1.00.3/raidlib.c	Wed Jan 15 08:58:25 2003
+++ raidtools-1.00.3-rgg/raidlib.c	Thu Nov 13 16:51:37 2003
@@ -460,11 +460,19 @@
       case raidstart:
       {
 	struct stat s;
+	int i=0;
+	for ( i=0; i< MD_SB_DISKS; ++i) {
+		
+		if (!cfg->device_name[i][0]) {
+			rc++;
+			break;
+		}
+		stat (cfg->device_name[i], &s);
 
-	stat (cfg->device_name[0], &s);
-
-	fd = open_or_die(cfg->md_name);
-	if (do_mdstart (fd, cfg->md_name, s.st_rdev)) rc++;
+		fd = open_or_die(cfg->md_name);
+		if ( ! do_mdstart (fd, cfg->md_name, s.st_rdev))
+			break;
+	}
 	break;
       }
 

Attachment: pgp00056.pgp
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux