summaryrefslogtreecommitdiffstats
path: root/super0.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-06-26 12:26:12 +1000
committerNeil Brown <neilb@suse.de>2006-06-26 12:26:12 +1000
commit08110d41bc376e0a5724ab54b72a8793d03a79c0 (patch)
treedf59f09f9d160b57a76a1998c4eba3e4baf1d517 /super0.c
parent7eae7080e2e9edd69d31ae2c88d9e28d1c24217c (diff)
downloadmdadm-08110d41bc376e0a5724ab54b72a8793d03a79c0.tar.gz
mdadm-08110d41bc376e0a5724ab54b72a8793d03a79c0.tar.xz
mdadm-08110d41bc376e0a5724ab54b72a8793d03a79c0.zip
Fix a recently introduced bug, and make --assemble more resilient to it.
Make -assemble a bit more resilient to finding strange information in superblocks. Don't claim newly added spares are InSync!! (don't know why that code was ever in there)
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/super0.c b/super0.c
index 0f993a2..da6671d 100644
--- a/super0.c
+++ b/super0.c
@@ -350,6 +350,7 @@ static void getinfo_super0(struct mdinfo *info, void *sbv)
/* work_disks is calculated rather than read directly */
for (i=0; i < MD_SB_DISKS; i++)
if ((sb->disks[i].state & (1<<MD_DISK_SYNC)) &&
+ (sb->disks[i].raid_disk < info->array.raid_disks) &&
(sb->disks[i].state & (1<<MD_DISK_ACTIVE)) &&
!(sb->disks[i].state & (1<<MD_DISK_FAULTY)))
working ++;
@@ -647,7 +648,6 @@ static int write_init_super0(struct supertype *st, void *sbv, mdu_disk_info_t *d
}
sb->disks[dinfo->number].state &= ~(1<<MD_DISK_FAULTY);
- sb->disks[dinfo->number].state |= (1<<MD_DISK_SYNC);
sb->this_disk = sb->disks[dinfo->number];
sb->sb_csum = calc_sb0_csum(sb);