On Thu, 30 May 2002, VanTo wrote: > I also wanted to ask if it is supported to use md array during recovery? > (with some journaling fs on it). When a system fails I have to wait for > about 1 hour while recovery finishes before i mount fs on md, or else it > crashes. I tried many kernel versions from 2.4.16 to 2.4.19-pre8, with > the same result. It *should* work. Are you using this on a SMP machine? There are some race situations causing crashes, but it should work with an UP machine. Here is a patch produced by gody@agenda.si that should help in SMP machine. It not pretty and it's not '100% right', but it seems to work. D.
diff -uNr linux.orig/drivers/md/md.c linux/drivers/md/md.c --- linux.orig/drivers/md/md.c Fri Dec 21 18:41:54 2001 +++ linux/drivers/md/md.c Mon Mar 11 13:29:50 2002 @@ -468,6 +468,19 @@ } } +static inline int mark_rdev_faulty (mdk_rdev_t * rdev) +{ + if (!rdev) { + MD_BUG(); + return 0; + } + if (rdev->faulty) + return 0; + free_disk_sb(rdev); + rdev->faulty = 1; + return 1; +} + static int read_disk_sb(mdk_rdev_t * rdev) { int ret = -EINVAL; @@ -3048,10 +3061,14 @@ rrdev = find_rdev(mddev, rdev); if (!rrdev || rrdev->faulty) return 0; + if (!mark_rdev_faulty(rrdev)) + return 0; if (!mddev->pers->error_handler || mddev->pers->error_handler(mddev,rdev) <= 0) { +/* free_disk_sb(rrdev); rrdev->faulty = 1; +*/ } else return 1; /*