linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug by starting with missed first devies - bug fix included !!
@ 2002-12-18 20:06 Christoph Plattner
  0 siblings, 0 replies; only message in thread
From: Christoph Plattner @ 2002-12-18 20:06 UTC (permalink / raw)
  To: linux-raid

Hello RADI hackers,

some days ago I recongnized, that `raidstart' has a problem, if 
`raid-disk 0' is missed or defect. This was a critical problem
on my RAID 5 for me.

Solution for this problem: try to use all devices to get RAID info,
not only the first defined device (bad design bug).

I am not sure, if this is already reported or fixed, I have release
20010914, and the raidstart `v0.3d'.

Please answer directly to me, I am not registered on the RAID
mailing list !! (Perhaps I will do in future).


One possible fix:

bash# diff -u raidlib.c.ORIG raidlib.c
--- raidlib.c.ORIG      Wed Dec 18 20:59:11 2002
+++ raidlib.c   Sun Dec 15 13:42:06 2002
@@ -395,11 +395,29 @@
        case raidstart:
        {
         struct stat s;
+       int did = 0;
+       int done = 0;
+
+       fd = open_or_die(cfg->md_name);

-       stat (cfg->device_name[0], &s);
+       while (cfg->device_name [did])
+       {
+           stat (cfg->device_name [did], &s);

-       fd = open_or_die(cfg->md_name);
-       if (do_mdstart (fd, cfg->md_name, s.st_rdev)) rc++;
+           if (do_mdstart (fd, cfg->md_name, s.st_rdev) == 0)
+           {
+               done = 1;
+               break;
+           }
+           did ++;
+       }
+
+       if (done == 0)
+       {
+           rc++;
+           close (fd);
+       }
+
         break;
        }



With friendly regards
Christoph Plattner



-- 
-------------------------------------------------------
private:	christoph.plattner@gmx.at
company:	christoph.plattner@alcatel.at


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-18 20:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-18 20:06 Bug by starting with missed first devies - bug fix included !! Christoph Plattner

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