summaryrefslogtreecommitdiffstats
path: root/Assemble.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 /Assemble.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 'Assemble.c')
-rw-r--r--Assemble.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Assemble.c b/Assemble.c
index aa7eeb2..90a9c57 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -499,6 +499,10 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
if (nextspare < info.array.raid_disks)
nextspare = info.array.raid_disks;
i = nextspare++;
+ } else {
+ if (i >= info.array.raid_disks &&
+ i >= nextspare)
+ nextspare = i+1;
}
if (i < 10000) {
if (i >= bestcnt) {