public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] misc minor md fixes
@ 2001-10-16  2:07 Tim Hockin
  0 siblings, 0 replies; only message in thread
From: Tim Hockin @ 2001-10-16  2:07 UTC (permalink / raw)
  To: mingo, neilb, Linux Kernel Mailing List, alan, torvalds

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

All,

Attached is a small patch to fix up some md issues we've run across.

The changes are pretty obvious, and were needed here - please apply.  Let
me know if there is a problem with them.

Thanks

Tim
-- 
Tim Hockin
Systems Software Engineer
Sun Microsystems, Cobalt Server Appliances
thockin@sun.com

[-- Attachment #2: md-misc.diff --]
[-- Type: text/plain, Size: 2502 bytes --]

diff -ruN dist-2.4.12+patches/drivers/md/md.c cvs-2.4.12+patches/drivers/md/md.c
--- dist-2.4.12+patches/drivers/md/md.c	Mon Oct 15 10:21:57 2001
+++ cvs-2.4.12+patches/drivers/md/md.c	Mon Oct 15 10:21:57 2001
@@ -542,8 +542,10 @@
 		goto abort;
 	}
 
-	if (calc_sb_csum(sb) != sb->sb_csum)
+	if (calc_sb_csum(sb) != sb->sb_csum) {
 		printk(BAD_CSUM, partition_name(rdev->dev));
+		goto abort;
+	}
 	ret = 0;
 abort:
 	return ret;
diff -ruN dist-2.4.12+patches/drivers/md/raid1.c cvs-2.4.12+patches/drivers/md/raid1.c
--- dist-2.4.12+patches/drivers/md/raid1.c	Mon Oct 15 10:21:58 2001
+++ cvs-2.4.12+patches/drivers/md/raid1.c	Mon Oct 15 10:21:57 2001
@@ -1690,7 +1690,8 @@
 		}
 	}
 
-	if (!start_recovery && !(sb->state & (1 << MD_SB_CLEAN))) {
+	if (!start_recovery && !(sb->state & (1 << MD_SB_CLEAN)) &&
+	    (conf->working_disks > 1)) {
 		const char * name = "raid1syncd";
 
 		conf->resync_thread = md_register_thread(raid1syncd, conf,name);
diff -ruN dist-2.4.12+patches/drivers/md/raid5.c cvs-2.4.12+patches/drivers/md/raid5.c
--- dist-2.4.12+patches/drivers/md/raid5.c	Mon Oct 15 10:21:58 2001
+++ cvs-2.4.12+patches/drivers/md/raid5.c	Mon Oct 15 10:21:57 2001
@@ -488,22 +488,24 @@
 	PRINTK("raid5_error called\n");
 
 	for (i = 0, disk = conf->disks; i < conf->raid_disks; i++, disk++) {
-		if (disk->dev == dev && disk->operational) {
-			disk->operational = 0;
-			mark_disk_faulty(sb->disks+disk->number);
-			mark_disk_nonsync(sb->disks+disk->number);
-			mark_disk_inactive(sb->disks+disk->number);
-			sb->active_disks--;
-			sb->working_disks--;
-			sb->failed_disks++;
-			mddev->sb_dirty = 1;
-			conf->working_disks--;
-			conf->failed_disks++;
-			md_wakeup_thread(conf->thread);
-			printk (KERN_ALERT
-				"raid5: Disk failure on %s, disabling device."
-				" Operation continuing on %d devices\n",
-				partition_name (dev), conf->working_disks);
+		if (disk->dev == dev) {
+			if (disk->operational) {
+				disk->operational = 0;
+				mark_disk_faulty(sb->disks+disk->number);
+				mark_disk_nonsync(sb->disks+disk->number);
+				mark_disk_inactive(sb->disks+disk->number);
+				sb->active_disks--;
+				sb->working_disks--;
+				sb->failed_disks++;
+				mddev->sb_dirty = 1;
+				conf->working_disks--;
+				conf->failed_disks++;
+				md_wakeup_thread(conf->thread);
+				printk (KERN_ALERT
+					"raid5: Disk failure on %s, disabling device."
+					" Operation continuing on %d devices\n",
+					partition_name (dev), conf->working_disks);
+			}
 			return 0;
 		}
 	}

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

only message in thread, other threads:[~2001-10-16  2:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-16  2:07 [PATCH] misc minor md fixes Tim Hockin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox