lkml.org 
[lkml]   [2001]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] misc minor md fixes
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.comdiff -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;
}
}
\
 
 \ /
  Last update: 2005-03-22 13:08    [W:0.045 / U:3.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site