From 08110d41bc376e0a5724ab54b72a8793d03a79c0 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 26 Jun 2006 12:26:12 +1000 Subject: 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) --- Assemble.c | 4 ++++ ChangeLog | 4 ++++ super0.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Assemble.c b/Assemble.c index aa7eeb2b..90a9c576 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) { diff --git a/ChangeLog b/ChangeLog index ecbb598b..75e53bbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ Changes Prior to this release to make it a bit easier to see what is happening. - Work around bug in --add handling for version-1 superblocks in 2.6.17 (and prior). + - 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) Changes Prior to 2.5.1 release - Various fixes for gcc warnings diff --git a/super0.c b/super0.c index 0f993a25..da6671d2 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<disks[i].raid_disk < info->array.raid_disks) && (sb->disks[i].state & (1<disks[i].state & (1<disks[dinfo->number].state &= ~(1<disks[dinfo->number].state |= (1<this_disk = sb->disks[dinfo->number]; sb->sb_csum = calc_sb0_csum(sb); -- cgit v1.2.3