summaryrefslogtreecommitdiffstats
path: root/super0.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-12-14 17:30:51 +1100
committerNeil Brown <neilb@suse.de>2006-12-14 17:30:51 +1100
commit67a8c82d6069e7cf7b3fef00d1442bb2fff6fecc (patch)
treec31f8dbcc341a199b606ee3397cbbc35dcfa2bab /super0.c
parent434b77559edef7bfd3e5f5366a2a00039baf7b48 (diff)
downloadmdadm-67a8c82d6069e7cf7b3fef00d1442bb2fff6fecc.tar.gz
mdadm-67a8c82d6069e7cf7b3fef00d1442bb2fff6fecc.tar.xz
mdadm-67a8c82d6069e7cf7b3fef00d1442bb2fff6fecc.zip
Make Assemble/Force work on raid6 with 2 missing devices.
Previously it onl worked when one missing device. Also split the "force" update_super method into two and it is really serving two functions.
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/super0.c b/super0.c
index 9e83193..2060e93 100644
--- a/super0.c
+++ b/super0.c
@@ -411,13 +411,21 @@ static int update_super0(struct mdinfo *info, void *sbv, char *update,
} else if (i >= sb->raid_disks && sb->disks[i].number == 0)
sb->disks[i].state = 0;
}
- if (strcmp(update, "force")==0) {
+ if (strcmp(update, "force-one")==0) {
+ /* Not enough devices for a working array, so
+ * bring this one up-to-date.
+ */
__u32 ehi = sb->events_hi, elo = sb->events_lo;
sb->events_hi = (info->events>>32) & 0xFFFFFFFF;
sb->events_lo = (info->events) & 0xFFFFFFFF;
if (sb->events_hi != ehi ||
sb->events_lo != elo)
rv = 1;
+ }
+ if (strcmp(update, "force-array")==0) {
+ /* degraded array and 'force' requested, so
+ * maybe need to mark it 'clean'
+ */
if ((sb->level == 5 || sb->level == 4 || sb->level == 6) &&
(sb->state & (1 << MD_SB_CLEAN)) == 0) {
/* need to force clean */