misc minor md fixes
PATCH 1/1 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
Signature · 4 lines
Tim Hockin Systems Software Engineer Sun Microsystems, Cobalt Server Appliances [email protected]
drivers/md/md.c +3 -1
@@ -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;
drivers/md/raid1.c +2 -1
@@ -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);
drivers/md/raid5.c +18 -16
@@ -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 ; } }