My collegue produced the patch bellow which helps in RAID5 OOPS situation. Please, check it out... D. ---------- Forwarded message ---------- Date: Mon, 18 Feb 2002 13:47:09 +0100 (CET) From: Matjaz Godec <gody@master.slon.net> To: Danilo Godec <danci@master.slon.net> Subject: Raid5 race patch Hi ! Below is raid5 race patch, which gets rid of OOPS. It's ugly as hell since it introduces too many new thing for my test, but I don't know how to set faulty flag other way (I copied relevant things from md.c). Main spirit of the patch is, to set faulty flag on the device before md_wakeup_thread is called. I don't see a way to eliminate the race on SMP machines without setting this flag inside raid5_error function. lp gody diff -uNr linux.orig/drivers/md/raid5.c linux/drivers/md/raid5.c --- linux.orig/drivers/md/raid5.c Wed Oct 17 23:21:00 2001 +++ linux/drivers/md/raid5.c Mon Feb 18 15:47:04 2002 @@ -482,6 +482,7 @@ raid5_conf_t *conf = (raid5_conf_t *) mddev->private; mdp_super_t *sb = mddev->sb; struct disk_info *disk; + mdk_rdev_t * rrdev; int i; PRINTK("raid5_error called\n"); @@ -499,6 +500,9 @@ mddev->sb_dirty = 1; conf->working_disks--; conf->failed_disks++; + rrdev = find_rdev(mddev, dev); + if ( rrdev ) + rrdev->faulty = 1; md_wakeup_thread(conf->thread); printk (KERN_ALERT "raid5: Disk failure on %s, disabling device." @@ -532,6 +536,9 @@ sb->failed_disks++; mddev->sb_dirty = 1; + rrdev = find_rdev(mddev, dev); + if ( rrdev ) + rrdev->faulty = 1; md_wakeup_thread(conf->thread); return 0; __________________________________________________________________ | Matjaz Godec | Agenda d.o.o. | ISP for business | | Tech. Manager | Gosposvetska 84 | WAN networks | | gody@slon.net | si-2000 Maribor | Internet/Intranet | | tel:+386.2.2340860 | Slovenija | Application servers | |http://www.slon.net |http://www.agenda.si | Caldera OpenLinux | - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html